I am getting this error in Chrome browser console. My page is using an external js file where the method is defined. Page is recognizing other methods but not recognizing this particular method.
Uncaught ReferenceError: getBillingAndShipping_AJAX is not defined at
<script type="text/javascript">
//<![CDATA[
Method1();Method2();Method3();updatecalender();UpdateItemDetailHeader();getBillingAndShipping_AJAX('0',1,0,0,'','False',''); EnableDisableHeaderInfo_ReviseOrder(false);DisableControlForContractorAndCS(true);HideDeleteForDependentItems();GetTimeDifference();hideinactive('content');$(document).ready(function() {changeoptions_user();if(typeof callAutocomplete!='undefined'){callAutocomplete();} });$(document).ready(function () {if($.browser.msie) {$('input:radio').css({ border:'none'}); $('input:checkbox').css({ border:'none'}); } });if(typeof js_load!='undefined') js_load();
var Page_ValidationActive = false;
This is my server side script.
I had tried both ScriptManager/ClientScript methods like RegisterClientScriptBlock and RegisterStartUpScript, but no luck. Please help.
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Bind Billing Shipping DDL", string.Format("getBillingAndShipping_AJAX('{0}',1,1,{1},'{2}','{3}','{4}');",
hdnFactoryID1.Value,
miCustomerType,
stVendorCode,
mbIsReviseOrder,
msEdiId), true);
Thanks all. I got the fix. I moved my js method on the page itself and it got recognized. It was not recognized if it was in js file. I dont know why. Its weird.
Related
Hello,
I am trying to test error supression on Sharepoint but I am having some trouble.
This is my process:
On a relatively plain website (all it contains is a colored-in div), I added this script:
<script>
var x[] = 0;
var err = 10/x;
alert(err);
</script>
When setting my Outlook homepage to this site, I see this error:
I also have the following script, which suppresses this message (when adding this to my code, the error message doesn't appear):
<script type="text/javascript">
window.onerror = function(message, url, lineNumber) {
// code to execute on an error
return true; // prevents browser error messages
};
</script>
I want to test this script out on my Sharepoint site, but when I embed the above, error-inducing code onto my Sharepoint homepage and open the page in Outlook, I am not seeing any error messages.
I added the code in the following ways:
1 - Page > Edit > Edit Source > Added the code to the top
2 - Page > Edit > Embed Code > Added the code to various areas of the page
Neither of these methods worked, and the first one actually produced a message telling me that I should use the embed function, which also doesn't seem to work!
I need to generate this error from the Sharepoint page so that I can check **whether the error-suppressing script actually does what it's supposed to. Can **anyone think of what may be going wrong here?
Any help is much appreciated!
This is apparently a known issue in Sharepoint, and can be resolved by using the following function:
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){
//your code goes here...
});
For the purposes of the above test, I was able to generate an error with the following:
<script language='javascript'>
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){
var x[] = 0;
var err = 10/x;
alert(err);
});
</script>
And adding the below suppressed the errors:
<script language='javascript'>
window.onerror = function(message, url, lineNumber) {
return true;
};
</script>
Note that this only worked for me after adding the 2 bits of code in their own, seperate <script> tags. I also had to add language='javascript' to the tags before it would work.
I added the code by embedding some new code, and adding both of the script tags to that web part. Because I was able to produce the error message, I was also able to prove that the error-suppression method worked.
I am having this issue due to using some third party script that is throwing me an error. The script relates to a wordpress plugin that has actually been published by the author.
I am using the 'iLightBox' plugin to display liteboxes for my images. However i need to set which images appear in the lightbox gallery. I have been using the developer website and found the following URL: http://www.ilightbox.net/faq.html
Script 5 appears to do what i need:
jQuery(document).ready(function(){
(function(){
var groupsArr = [];
$('[rel^="ilightbox["]').each(function () {
var group = this.getAttribute("rel");
$.inArray(group, groupsArr) === -1 && groupsArr.push(group);
});
$.each(groupsArr, function (i, groupName) {
$('[rel="' + groupName + '"]').iLightBox({ /* options */ });
});
})();
});
I am running this code in a custom.js file and i can see using 'inspect element' in Chrome that the file is loading correctly but the script is erroring with the following:
"Uncaught TypeError: $ is not a function".
I have read through some posts by other users who explain i need to encapsulate with a function and finish with '(jQuery)' however if i do this it just generates more errors.
Can anyone assist me?
My website where the error is showing: http://www.complete-models.com/uncategorized/16-alien-figure/
If you can change your code just replace $ to jQuery
$('[rel^="ilightbox["]').each(function () {
to
jQuery('[rel^="ilightbox["]').each(function () {
Make sure that you custom.js loaded after jQuery so in html file <scipt> tag for jQuery should be above custom.js
I have the following script tag in my JSP file:
<script src="/js/CCTUtil.js"></script>
with the following function in it:
function disableButton(buttonID) {
document.getElementById(buttonID).setAttribute("disabled", "true");
return true;
}
and in my jsp I call it with:
onchange="disableButton('datasourceForm:cancel');
datasourceForm:cancel is just the ID, so don't worry about that.
This works if I hardcode the JS function in my JSP, but when exporting it to a file, it doesn't work. It recognizes the valid filepath (otherwise the server throws an exception) so it can see the file just fine, but when testing it in Internet Explorer the error is "Object expected", and points to the end of the JSP file, which of course isn't telling of anything.
Help please?
The SRC must not be correct then. Are you sure you have set the path correctly? It's not supposed to be "../js/CCTUtil.js" is it?
Instead of including script file, directly add javascript function in the jsp file.
Then try, if you are getting the same issue, might be some issue with javascript or ur id datasourceForm:cancel
I'm working on a fairly simple site using Twitter Bootstrap. I'm having an issue with getting my Google Maps plugin to work. On localhost using Apache, it works fine. On the server, also Apache, it does not. I get this error:
Uncaught SyntaxError: Unexpected token <
On the first line of this file (jquery.ui.map.min.js):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html><head>
<title>Menu for /assets/js/jquery.ui.map.min.js</title>
</head><body>
<h1>Menu for /assets/js/jquery.ui.map.min.js</h1>
<hr />
<pre> jquery-ui-map</pre>
<pre> d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new</pre>
</body>
</html>
Here is a link to see the problem:
http://jhfc-law.com/contact.html
Again, the map and everything work fine locally. I'm sure the server is reading that DOCTYPE line as an issue due to the opening <, but I'm unsure how to fix this. It's causing this error as well (since the first file is breaking, gmap isn't being initialized so I can't use this following line):
Uncaught TypeError: Object [object Object] has no method 'gmap'
Which is in this method in my scripts.js file (which is being loaded after the previous file):
jQuery(document).ready(function() {
var position = new google.maps.LatLng(31.22633, -85.39422);
$('.map').gmap({'center': position,'zoom': 15, 'disableDefaultUI':true, 'callback': function() {
Uncaught TypeError: Object [object Object] has no method 'gmap'
var self = this;
self.addMarker({'position': this.get('map').getCenter() });
}
});
});
Any help is appreciated!
T
Your map javascript isn't on the server. This is what you're linking to: http://jhfc-law.com/assets/js/jquery.ui.map.min.js
Furthermore, it looks like the correct (?) link is broken as well: http://jhfc-law.com/assets/js/jquery-ui-map
I'd like to try to get BiwaScheme to run is JSFiddle, please.
The BiwaScheme page claims that all you need to do is:
<script src="biwascheme.js">
(display "hello, world!")
</script>
So I added the resource http://www.biwascheme.org/repos/release/biwascheme-min.js in JSFiddle, and the (display ...) in the JavaScript window.
http://jsfiddle.net/MsjMH/1/
However, nothing happens. The console error I am getting is:
// Uncaught SyntaxError: Unexpected string
What am I missing here?
You can evaluate a string as Scheme program with BiwaScheme.Interpreter.
Example:
http://jsfiddle.net/TaEEN/1/
(FYI) There is also BiwaScheme-fiddle: http://blackboard.biwascheme.org/