Javascript error when running on different pages - javascript

I have a standalone form. My issue is when I run the form standalone it runs fine but when the form code is included in some other page where it is supposed to be displayed it shows
Uncaught TypeError: Cannot read property 'value' of undefined at submit:10
I have tried debugging it from last few hours but still not able to find the exact issue. could someone please point out where the mistake might be. It could be some small error but it will be really helpful if you could point it out.
Both the forms are these: Standalone form and form included in a page

The moment you load your page you will see an error:
Uncaught ReferenceError: field is not defined
That is because field is defined here:
https://simrec.custhelp.com/rnt/rnw/javascript/enduser.js
which is not included in the other page. You are using new field() in your code without having it defined. Fix that and the rest could work if it's working in the standalone form.

Related

debugging javascript console error

I just got some big project and with error in console. there are many more than scripts used at that page but error shows very little information. there are 25 scripts loading at page. To give you an idea how many scripts they are you can see. :(
I have error in console but i can't find which original file, line number causing it. the error showing are in library. but i know it's not library bug it's caused by some other script. but this stack trace is very small. is there any tool or any other way where i can originally find from where it is originating.
let me know if further information is required.
If you click on link "amstock.js" you will be redirect to that file and directly in the line that was causing the error. Always the upper file is which causes the problem, but some times because of a previous one.
In adition, the error maybe cause by an asynchronous call that leaves your variable in null and fill it after the line of the error was call, or just you are trying to access a wrong variable. Check that line.

Dynamic java script zoom error in vb.net project

I inherited a legacy VB.net project that always has the following error:
document.body.style.zoom = screen.logicalXDPI / screen.deviceXDPI;
The exact error message from VIsual Studio is as follows:
JavaScript runtime error: Unable to get property 'style' of undefined or null reference
I have searched the entire solution, but none of the relevant variables/attributes show up.
I assume this is a javascript or jquery problem, the debugger says that it is a script block [dynamic] and the Call Stack says that it is global code.
Has anyone seen this error before?
Please help. Thanks in advance.
Believe it or not, removing add-ins in the browser did the trick (thanks to a colleague). It's not in the code-base at all in this case. The specific culprit was a MacAfee add-in. I never would have guessed this.

uncaught typeerror: cannot read property cookie of undefined

First of all I want to say that i've searched across the internet and could not find my answer anywhere.
I've tried to use jquery-coockie.js into my wordpress template, where i've created my own page for some kind of calculator.
When i'm trying to excecute my
if ($.cookie('cart')){
it gives me the error :
uncaught typeerror: cannot read property cookie of undefined
I've included my jquery-cookie.js correctly, so not-including is not giving me the problem.
link to website
Seems that jQuery is in noconflict mode.
Try this code:
jQuery.cookie('cart')
The error you've pasted indicates that JQuery is not defined. Did you include that earlier in the page?
In other locations on the page, you refer to JQuery by calling jQuery(...), so it seems that you do have it, but it's stored as a different variable.
If you're controlling the line that fails (if it's not a part of that external Cookie script), use jQuery.cookie(...) instead.
If you don't control the script adding JQuery to the page, you could instead alias it to $ yourself -- $ = jQuery;

Javascript error on Magento - Registry Undefined

We have a JavaScript error on our website (http://www.sointeriors.co.uk) and we are experiencing frequent add to cart errors which may or may not be associated with the error but either way we need it fixing so we can rule it out as causing the add to cart error.
Anyway I'm not good with JavaScript, the error in Firebug is as follows:
Error
TypeError: registry is undefined ... line 540 of hello.jquery.js
Code
var respondersForEvent=registry.get(eventName);
if(Object.isUndefined(respondersForEvent)){
respondersForEvent=[];
registry.set(eventName,respondersForEvent);
}
Does this error mean anything to someone who knows JavaScript or can anyone tell me what needs to be done to correct this? It's appearing on every page of the website.

Uncaught ReferenceError: chrome_fix3 is not defined _cmp_execLogic._cmp_suclick

I am getting the following error. How can I resolve this?
Uncaught ReferenceError: chrome_fix3 is not defined
_cmp_execLogic._cmp_suclick
Good news - the error is nothing to do with your site.
Bad news - it's caused by an erroneous browser extension that's injecting invalid javascript into your pages. I have an ever increasing list of similarly caused errors that we can do nothing other than trap and ignore. At some point I intend to feed a message back to the user that something they have installed may cause problems on our sites, but ideally I'd like to tell them exactly what extension is causing the issue, which I don't know in all cases.
If anyone knows where the attempt to reference "chrome_fix3" actually comes from, please add to this post.
A similar error that we trap but is nothing to do with our code is:
Uncaught ReferenceError: conduitPage is not defined
I found the following pages helpful when investigating the error:
https://webmademovies.lighthouseapp.com/projects/65733/tickets/2895-crash-referenceerror-conduitpage-is-not-defined
http://www.youtube.com/user/conduityoursite#g/c/4B820DE13E03888D
Your code tries to refer to a variable or property that does not exist, in your case it's named chrome_fix3.
This probably came from a javascript libary that you are using, maybe jQuery or something.
I assume that the library is fine and it's caused by wrongfully calling some of it's functions.
The best way now is to install the Firebug plugin in Firefox (you could use Chrome, Opera or Internet Explorer's debugger but I like Firebug best)
Then add following code in your code where you think it's going wrong:
//add the following line only once:
var okCounter=0;
// add teh following line every couple of lines in your code:
console.log("still ok here:",okCounter++);
Open your page in Forefox and hit F12, the Firebug window should show up now. Reload the page and check out the console tab.
At some point you should notice there is no more output to the console where there should be; now you have found the part in your code where something goes wrong. If you post that part we might be able to help you out more.

Categories

Resources