dadimp_won Posted March 17, 2012 Share Posted March 17, 2012 IE 9, Windows 7 == I am trying to get started in Java Script for personal use. HTML runs fine but Java Script is ignored as the offline level. The book I am using said "<script Language="JavaScript">"' W3 used "<script type = "text/javascript"> I assume that either should work. However both are ignored. I then copied a w3 try it sample using the copy/paste commands so there should be no typo errors. Same Result. Tried a different w3 sample with the same result. Both were simple ones using script to display a one-line message. Again the html works fine but the script is ignored. Must be something i am missing -- but cant figure what. Have no web page so cant tell if they would fail there also. IE works fine across all pages i have visited. The copied try it samples worked fine on the w3 page. Would appreciate any thots or suggestions. Link to comment Share on other sites More sharing options...
niche Posted March 17, 2012 Share Posted March 17, 2012 Does it work in Firefox? Link to comment Share on other sites More sharing options...
eTianbun Posted March 17, 2012 Share Posted March 17, 2012 Are you using: document.write() to print out the one line message? Link to comment Share on other sites More sharing options...
dadimp_won Posted March 17, 2012 Author Share Posted March 17, 2012 dont have firefox.One of the w3 trials used document write.The other made a <p></p> to do the writing. Link to comment Share on other sites More sharing options...
eTianbun Posted March 17, 2012 Share Posted March 17, 2012 <p id='p'>old entry!</p> document.getElementById('p').innerHTML='New entry!' NB: Make sure the <p> element is ontop of the <script>, so that the <p> will be created, before the command is executed! Link to comment Share on other sites More sharing options...
eTianbun Posted March 17, 2012 Share Posted March 17, 2012 Post the code you are trying, lets see! Link to comment Share on other sites More sharing options...
dadimp_won Posted March 18, 2012 Author Share Posted March 18, 2012 Here is the code"<html><body><h1>My First Web Page</h1><script type="text/javascript">document.write("<p>" + "Mike" + "</p>");</script></body></html>Copied directly from w3 sample. When it didnt work I changed the original date function to "Mike" thinking thatpossibly the date function was fouling it up. No luck -- the html H1 works but the script is ignored. Link to comment Share on other sites More sharing options...
Ingolme Posted March 18, 2012 Share Posted March 18, 2012 It works for me in Firefox. Internet Explorer first asks me whether I'd like to execute local scripts or not, but then it works. Your browser settings may have told it to ignore all local scripts. Link to comment Share on other sites More sharing options...
dsonesuk Posted March 18, 2012 Share Posted March 18, 2012 Which browser are you using? I tested this and it works fine! Try simple javascript without document.write <html><body><h1>My First Web Page</h1><script type="text/javascript">alert("mike");</script></body></html> if alert appears we know js is enabled, and working, and so original script should work also. Link to comment Share on other sites More sharing options...
dadimp_won Posted March 18, 2012 Author Share Posted March 18, 2012 First to dsonesuk: Your code did not work for me : Appreciate the try and any more ideas you might have. To Ingolme: Your Idea is probably right. I found several references to scriipt in IE Security Settings which I changed.I must not have found the right one. Could u be a bit more specific on which one worked for you. I get no prompts. It just doesnt work! Link to comment Share on other sites More sharing options...
dsonesuk Posted March 18, 2012 Share Posted March 18, 2012 go to internet options tools -> internet options select security tab, select zone internet , select default then OK, if set at highest it will disable js scripts. Link to comment Share on other sites More sharing options...
dadimp_won Posted March 18, 2012 Author Share Posted March 18, 2012 dsonesuk; Set both internet zone and intranet zone security to default: No Change. Any other thoughts? Link to comment Share on other sites More sharing options...
dsonesuk Posted March 18, 2012 Share Posted March 18, 2012 Are you creating this in notepad? if so, open in notepad, select save as, in the save as menu select UTF-8 from the dropdown menu for encoding, OK, and yes to replace, and then try it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.