使用href属性或表单操作属性调用的网页不加载jquerys document.ready() [英] web page called using href attribute or forms action attribute does not load jquerys document.ready()

查看:65
本文介绍了使用href属性或表单操作属性调用的网页不加载jquerys document.ready()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页和一个与之关联的jquery。

当我使用按钮onclick()调用url时,使用jquery应用的样式被加载但是当使用href调用时相同的页面然后是jquery的document.ready未加载,并且未应用样式。我搜索了很多,但没有找到任何合适的解决方案。刷新时正确加载相同的页面。请给我一个替代解决方案。在此先感谢





JQuery代码

I have a web page and a jquery associated with it.
When i call url using buttons onclick() then the styles applied using jquery is loaded but the same page when called using href then the jquery's document.ready is not loaded and the styles are not applied. I searched a lot but did not found any suitable solution. Same page when refreshed loads properly. please provide me an alternative solution to it. Thanks in advance


JQuery Code

$(document).ready(function() {

			
		$('#select-custom-23-button').removeClass('ui-icon-carat-d ui-btn-icon-right');
		$('#select-custom-23-button').css('background','url(../Pages/Images/selectlist.png) no-repeat');
		$('#select-custom-23-button').css('border','0');
		$('#select-custom-23-button').css('height','10px');
		$('.filterSearchOption .ui-select .ui-btn > span:not(.ui-li-count)').css('display','none');
		$(".search-type").text('Keyword');
							
		
	
});









ASP代码:







ASP Code:

<div id="SearchBar">
								<form action="searchList.aspx" method="GET" id="osForm">
									<label class="search-type" style="margin-bottom: -5px;    margin-left: 50px; padding-bottom:2x;padding-top:10px;color:#3388CC ;    width: auto; font-weight:bold;"></label>
									
									<table class="SearchContainer">
										<tbody>
											<tr>
												<td class="filterSearchOption">
													
													<select id="select-custom-23" data-native-menu="false">
														<option></option>
														<option ref="KEY" id="key"><a href="#Key">Keyword</a></option>
														<option ref="CITE">Citation</option>
														<option ref="PARTY"></option>
														<option ref="SECTION"></option>
														<option ref="DOCKETNO"></option>
														<option class="cancel"></option>
										
													</select>
												</td>
												 <td class="search-input">
													<input placeholder="Type your search here" data-clear-btn="true" name="query" id="text1" type="text" />
													<input type="hidden" name="searchCriteria" id="searchCriteria" value="KEY" />
												</td>
												<td class="search-button">
													<input type="image" alt="" class="search-button"/>
												</td>
												
											</tr>
										 </tbody>
								 </table>
							   </form>
							 </div>

推荐答案

(文件).ready(function(){
(document).ready(function() {


('#select-custom-23-button')。removeClass('ui-icon-carat-d ui-btn-icon-right');
('#select-custom-23-button').removeClass('ui-icon-carat-d ui-btn-icon-right');


(' #select-custom-23-button')。css('background','url(../ Pages / Images / selectlist.png)no-repeat');
('#select-custom-23-button').css('background','url(../Pages/Images/selectlist.png) no-repeat');


这篇关于使用href属性或表单操作属性调用的网页不加载jquerys document.ready()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆