stockton Posted July 5, 2013 Share Posted July 5, 2013 (edited) I have javascript as follows function newDoc() { window.location.href = "http://192.168.0.8/devit/logon.html"; } If I call this function from my javascript as follows newDoc();[/code]it fails but if called from HTML[code]<input type="button" nanme="SelectButton" id="SelectButton" value="Login" onclick="newDoc()" height="50" /> it works.Please tell me what I am getting wrong. Edited July 5, 2013 by stockton Link to comment Share on other sites More sharing options...
jeffman Posted July 5, 2013 Share Posted July 5, 2013 You should post the code leading up to the function call. I suspect something there is failing and the function isn't really getting called at all. Link to comment Share on other sites More sharing options...
davej Posted July 5, 2013 Share Posted July 5, 2013 https://developer.mozilla.org/en-US/docs/Web/API/window.location http://www.w3schools.com/jsref/obj_location.asp Link to comment Share on other sites More sharing options...
stockton Posted July 6, 2013 Author Share Posted July 6, 2013 Using alert() has helped resolve this issue. Thanks for your input. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now