1.修改Micros版学校列表不可用的问题

2.修改正式版、测试学校列表访问版跨域的问题
This commit is contained in:
sw 2014-10-25 11:57:39 +08:00
parent b141afe98d
commit 54e8df06cd
2 changed files with 24 additions and 4 deletions

View File

@ -14,9 +14,14 @@
<script type="text/javascript"> <script type="text/javascript">
function get_options(value) { function get_options(value) {
prefix = '';
if(location.href.contains('ros'))
{
prefix = '/ros'
}
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: 'http://<%= Setting.host_user%>/school/get_options/' + encodeURIComponent(value), url: prefix + '/school/get_options/' + encodeURIComponent(value),
data: 'text', data: 'text',
success: function (data) { success: function (data) {
$("#province").val(value); $("#province").val(value);

View File

@ -2,10 +2,15 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
prefix = '';
if(location.href.contains('ros'))
{
prefix = '/ros'
}
$("#province").html("<option value='0' selected = true style='display: none;'></option>"); $("#province").html("<option value='0' selected = true style='display: none;'></option>");
$.ajax({ $.ajax({
type :"POST", type :"POST",
url :'http://<%= Setting.host_course %>/school/get_province', url :prefix + '/school/get_province',
data: "send", data: "send",
success: function(data, textStatus){ success: function(data, textStatus){
$("#province").append(data.text); $("#province").append(data.text);
@ -17,9 +22,14 @@
<script type="text/javascript"> <script type="text/javascript">
function get_school(value){ function get_school(value){
prefix = '';
if(location.href.contains('ros'))
{
prefix = '/ros'
}
$.ajax({ $.ajax({
type :"POST", type :"POST",
url :'http://<%= Setting.host_course %>/school/get_schoollist/'+encodeURIComponent(value), url :prefix + '/school/get_schoollist/'+encodeURIComponent(value),
data :'text', data :'text',
success: function(data){ success: function(data){
$("#schoollist").html(data); $("#schoollist").html(data);
@ -44,9 +54,14 @@
alert("<%= l(:label_search_conditions_not_null) %>"); alert("<%= l(:label_search_conditions_not_null) %>");
return; return;
} }
prefix = '';
if(location.href.contains('ros'))
{
prefix = '/ros'
}
$.ajax({ $.ajax({
type :"POST", type :"POST",
url :'http://<%= Setting.host_course %>/school/search_school/?key_word='+encodeURIComponent(value)+'&province='+province, url :prefix + '/school/search_school/?key_word='+encodeURIComponent(value)+'&province='+province,
data :'text', data :'text',
success: function(data){ success: function(data){
$("#schoollist").html(data); $("#schoollist").html(data);