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

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Cool Syntax error in the html


    I am trying to create a HTML which will have a Link which open a new window with a URL.

    I did as below: But not working


    Code:
    PaintSetHeader("Reconcilation Set Details <a href='#'  onclick='window.open('http://XX.XX.XX.XX:82/sitepages/ErViewPop.aspx?Jump=Free&ErNo='" + erNo + "',','','titlebar=no,toolbar=no,resizable=yes,scrollbars=yes');>" + erNo + "</a>", TableMain, 9, setData.Id);

    The first parameter is a string type where I need a HTML with a link which can be opened to a new window url
    Please help me in this syntax error.
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,175
    Rep Power
    184
    You needed to escape some of your quotes. In theory... the code below should now work:
    Code:
    PaintSetHeader("Reconcilation Set Details <a href=\"#\"  onclick=\"window.open('http://XX.XX.XX.XX:82/sitepages/ErViewPop.aspx?Jump=Free&ErNo='  + erNo + '','','titlebar=no,toolbar=no,resizable=yes,scrollbars=yes')\">" + erNo + "</a>", TableMain, 9, setData.Id);
    I think I got every thing corrected, but test it out; as I may have missed something.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Cool Error


    Originally Posted by web_loone08
    You needed to escape some of your quotes. In theory... the code below should now work:
    Code:
    PaintSetHeader("Reconcilation Set Details <a href=\"#\"  onclick=\"window.open('http://XX.XX.XX.XX:82/sitepages/ErViewPop.aspx?Jump=Free&ErNo='  + erNo + '','','titlebar=no,toolbar=no,resizable=yes,scrollbars=yes')\">" + erNo + "</a>", TableMain, 9, setData.Id);
    I think I got every thing corrected, but test it out; as I may have missed something.
    Not working mate ..its giving error while running ..


    saying "erNo" is undefined
  6. #4
  7. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,175
    Rep Power
    184
    That's a simple fix... just define your "erNo" variable; like so:
    Code:
    var erNo = "abc";
    PaintSetHeader("Reconcilation Set Details <a href=\"#\"  onclick=\"window.open('http://XX.XX.XX.XX:82/sitepages/ErViewPop.aspx?Jump=Free&ErNo='  + erNo + '','','titlebar=no,toolbar=no,resizable=yes,scrollbars=yes')\">" + erNo + "</a>", TableMain, 9, setData.Id);

IMN logo majestic logo threadwatch logo seochat tools logo