When I include the following js file (with jquery in it), I get the error in Firebug "XML can't be the whole program"
JS file include reference:
<script src="~/Scripts/scriptname.js" type="text/javascript"></script>
JS file contents:
$("[id*='txtAddress1S']")
.blur(function(){
$("[id*='txtAddress1S']")
.val().match(
/\b[p]*(ost)*\.*\s*[o|0]*(ffice)*\.*\s*b[o|0]x\b/i)&&
(alert("Packages are not deliverable to a Post Office Box.
\nPlease provide a different shipping address."),
$("[id*='txtAddress1S']").focus())
});
Thanks in advance!
It might be that your script src
attribute is not properly understood with the ~
and being parsed as an empty <script>
tag instead. Use the full path to the javascript file, or a path relative to the page it's loading on:
<script src="/full/path/to/Scripts/scriptname.js" type="text/javascript"></script>
<script src="../relative/to/Scripts/scriptname.js" type="text/javascript"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With