I have 1 HTML Page and 1 js file . I cannot run script in Firebug on Chrome
it shows following Error :
Access to restricted URI denied.
Code is as per tutorial
HTML Page
<!DOCTYPE html >
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery Example </title>
</head>
<body>
<input type="button" value="Hide" id="toggle_messege" />
<p id="messege">
You see this paragraph
</p>
<script type="text/javascript" src="~/js/toggle.js"></script>
<script type="text/javascript" src="~/js/jquery-1.7.1.min.js"></script>
</body>
</html>
js file
$('#toggle_messege').click(function () {
var value = $('#toggle_messege').attr('value');
$('messege').toggle('fast');
if (value == 'Hide') {
$('#toggle_messege').attr('value', 'Show');
}
else if (value == 'Show') {
$('#toggle_messege').attr('value', 'Hide');
}
});
Similar post : Error: "Access to restricted URI denied"
http://jquery-howto.blogspot.in/2008/12/access-to-restricted-uri-denied-code.html
They suggest it is same domain policy issue and solution is to access file from webserver(localhost)
my url is
http://localhost/WebApplication2/js/
But couldnot solve the issue .. plz suggest if something missing