Friday, May 17, 2024
97
rated 0 times [  98] [ 1]  / answers: 1 / hits: 20409  / 11 Years ago, thu, june 20, 2013, 12:00:00

I am getting this error when i run my webpage in IE(the code runs fine in other browsers).



This is the HTML code:



<!DOCTYPE html>
<html>
<head>
<script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js></script>
</head>
<body>
<--- some html code --->
<iframe src='http://localhost/page1.php' style=background: transparent; overflow: hidden; height: 210px; width: 390px; frameborder=0 />
</body>
</html>


This is page1.php



<!DOCTYPE html>
<html>
<body>
<form action=usercheck.php method=POST>
USERNAME:<input name=uname id=uname type=text maxlength=12 required/>
<input type=submit value=Submit>
</form>
</body>
</html>


This is usercheck.php



<?php
//some php code
?>
<!DOCTYPE html>
<html>
<head>
<script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js></script>
</head>
<body>
<--- some html code --->
</body>
</html>


The problem is that when reach usercheck.php after clicking on submit button in page1.php i get the error http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js. Access is denied. Here is an image of the error: http://i.stack.imgur.com/diCoF.jpg . Then consequently i get the error that '$' symbol is not defined(which is due to the failure to load the jquery library).



EDIT-
I have tried including the jquery file in my server but still the error is comming. I have also tried this code for usercheck.php:



<!DOCTYPE html>
<html>
<head>
<script type=text/javascript>
/*! jQuery v1.10.1 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery.min.map
//and the rest of the jquery library...
</script>
</head>
<body>
<--- some html code --->
</body>
</html>


The error i am getting this time is this:http://i.stack.imgur.com/hR9aN.jpg (The original name of usercheck2.php is rscheck.php in my server). Then consequently i get the error that '$' symbol is not defined(which is due to the failure to load the jquery library). If i directly open the contents of page1.php (by the url- localhost/page1.php) then everything works fine.



This is the only code for which i am using JQuery:



if($(#pret).contents().text().search(NAMECHECK: NOTAVALIBLE)!=-1)


I could exclude jquery only if i can convert this code to javascript.


More From » internet-explorer

 Answers
34

Here is the working solution to my question. The reason i wanted jquery was that i wanted to run this code:



if($(#pret).contents().text().search(NAMECHECK: NOTAVALIBLE)!=-1)


I removed jquery library and used this javascript to do the same:



var n=document.getElementById(pret).innerHTML.search(NAMECHECK: NOTAVALIBLE);
if(n != -1)


Now there is no error in the page and i am able to do what i wanted. So the error was caused as jquery library was not able to load in the webpage. But i dont know why even after downloading the jquery library in my server i was getting the same error ie. 'Access is denied'.


[#77519] Wednesday, June 19, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
quentinaveryb

Total Points: 102
Total Questions: 100
Total Answers: 93

Location: Colombia
Member since Mon, May 2, 2022
2 Years ago
quentinaveryb questions
Thu, Aug 6, 20, 00:00, 4 Years ago
Fri, Jul 17, 20, 00:00, 4 Years ago
Mon, Aug 12, 19, 00:00, 5 Years ago
;