修改js判断指定字符串是否含有指定子串不正确的问题

This commit is contained in:
sw 2014-10-25 15:36:26 +08:00
parent 54e8df06cd
commit 9707049703
2 changed files with 9 additions and 9 deletions

View File

@ -14,10 +14,10 @@
<script type="text/javascript"> <script type="text/javascript">
function get_options(value) { function get_options(value) {
prefix = ''; var prefix = "";
if(location.href.contains('ros')) if(location.href.indexOf('ros')>=0)
{ {
prefix = '/ros' prefix = "/ros"
} }
$.ajax({ $.ajax({
type: "POST", type: "POST",

View File

@ -2,8 +2,8 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
prefix = ''; var prefix = '';
if(location.href.contains('ros')) if(location.href.indexOf('ros') >= 0)
{ {
prefix = '/ros' prefix = '/ros'
} }
@ -22,8 +22,8 @@
<script type="text/javascript"> <script type="text/javascript">
function get_school(value){ function get_school(value){
prefix = ''; var prefix = '';
if(location.href.contains('ros')) if(location.href.indexOf('ros') >= 0)
{ {
prefix = '/ros' prefix = '/ros'
} }
@ -54,8 +54,8 @@
alert("<%= l(:label_search_conditions_not_null) %>"); alert("<%= l(:label_search_conditions_not_null) %>");
return; return;
} }
prefix = ''; var prefix = '';
if(location.href.contains('ros')) if(location.href.indexOf('ros') >= 0)
{ {
prefix = '/ros' prefix = '/ros'
} }