#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2008
    Posts
    41
    Rep Power
    7

    HTML works but javascript fails with href


    I have javascript as follows
    Code:
    function newDoc()
        {
        window.location.href = "http://192.168.0.8/devit/logon.html";
        }
    If I call this function from my javascript as follows
    Code:
            newDoc();
    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.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    101
    Rep Power
    27
    I think you need to provide more context. Calling that function from some other javascript function should be fine. Why not set up a jsfiddle that demonstrates your problem?

IMN logo majestic logo threadwatch logo seochat tools logo