external javascript not working
-
I'm having problems with external js file. When the function is within the html page, it works fine. as soon as I reference it to external source it doesn't. External file: xml.js function helloworld1() { document.write(
helloworld world
); return } web page: function helloworld1() { document.write("helloworld world"); return } </head> <body> <script type="text/javascript"> var m = helloworld(); Click me to display Date and Time.
-
I'm having problems with external js file. When the function is within the html page, it works fine. as soon as I reference it to external source it doesn't. External file: xml.js function helloworld1() { document.write(
helloworld world
); return } web page: function helloworld1() { document.write("helloworld world"); return } </head> <body> <script type="text/javascript"> var m = helloworld(); Click me to display Date and Time.
Probably your reference is wrong...It may be
src="xml.js"
or some ore complicated path...Use the built in debugger of your browser and check console messages to see if the external file was loaded at all...Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
Probably your reference is wrong...It may be
src="xml.js"
or some ore complicated path...Use the built in debugger of your browser and check console messages to see if the external file was loaded at all...Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
but i can put alert messages in there and they get fired off in other parts of the same script section you get variables from the database there in that edit form sitting in the controls mostly textboxes and then when clicking submit they all get sent into the db to update the db table so in the html the variable is there, sometimes its visible in the alert("value is: "+ $'(variablename).val')); but if the variable.val() isnull or == null or == "" then it should set that variable.val() = "No"; sometimes it works, sometimes not this is with a handler that runs after the window.load ? when the DOM is fully ready and all the images are drawn, then it runs code to check for certain null values and if null replace that with string 'no' otherwise dont care. thanks
-
I'm having problems with external js file. When the function is within the html page, it works fine. as soon as I reference it to external source it doesn't. External file: xml.js function helloworld1() { document.write(
helloworld world
); return } web page: function helloworld1() { document.write("helloworld world"); return } </head> <body> <script type="text/javascript"> var m = helloworld(); Click me to display Date and Time.
It works the same. Your problem may be timing issue. The provided code doesn't show the usage of the xml functions and I'm assuming you execute some xml function while the xml.js is being loaded. Before you make any call to functions defined in the xml.js file, you have to make sure that the file has been loaded successful.