Results 1 to 3 of 3

Thread: New CPanels (need help)

  1. #1
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Question New CPanels (need help)

    So, I found this really cool side panel script I could use as new CPanels for my site. (kapleenmusic.webfreehosting.net) I just have one question; How can I use HTML inside Javascript, if you know what I mean.
    Code:
    p = new createPanel('p','testpanel');
      p.addButton('peditor.gif','Personal<BR>Editor','alert("Personal Editor")');
      p.addButton('logo.gif','test<br>button','alert("linkhere")');
      o.addPanel(p);
    Note I have two buttons in there, top being used as example when I'm editing. The second button is what we're watching here; Anyways, to the point, in the
    'alert("linkhere")'
    part, I would like to use HTML inside that javascript alert.
    Ex:
    'alert("<a href="http://dynamicdrive.com">DynamicDrive</a> rocks.")'
    I tried that and it failed, what should I do?
    EDIT: Got it to work, actually the code I was supposed to add was parent.main.location="http://link.com".
    EDIT: Nevermind :/ It won't go to the link. http://kapleenmusic.webfreehosting.net/outlook.html to see for yourself..
    Last edited by [Nicolas]; 09-14-2010 at 09:30 PM.

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    alert("<a href="http://dynamicdrive.com">DynamicDrive</a> rocks.");
    can be done 2 ways I think...

    Code:
    alert('<a href="http://dynamicdrive.com">DynamicDrive</a> rocks.');
    or

    Code:
    alert("<a href=\"http://dynamicdrive.com\">DynamicDrive</a> rocks.");
    Corrections to my coding/thoughts welcome.

  3. #3
    Join Date
    Sep 2010
    Location
    Hi Stalker.
    Posts
    148
    Thanks
    16
    Thanked 3 Times in 3 Posts

    Default

    Now I have another issue, when I test the page, NOTHING is there. Example HTML included. No matter what I do to fix this won't work
    EDIT: I got it to work, I opened up "outlook.html" and used the code from that, though I don't see why the other pages weren't working :/
    Last edited by [Nicolas]; 09-14-2010 at 09:17 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •