SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    location.search using onclick event

    I am trying to hack a wysiwyg editor that uses the following to trigger the bold execCommand.

    Code:
    document.writeln('<td><img class="rteImage" src="' + imagesPath + 'bold.gif" width="25" height="24" alt="Bold" title="Bold" onClick="FormatText(\'' + rte + '\', \'bold\', \'\')"></td>');
    What I want to do is to make sure the bold icon remains active/depressed until it is clicked again. I am not sure if I can capture the exec event. What I thought about doing is adding a query string as so:

    Code:
    document.writeln('<td><img class="rteImage" src="' + imagesPath + 'bold.gif" width="25" height="24" alt="Bold" title="Bold" onClick="FormatText(\'' + rte + '\', \'bold\', \'\')?setBold=active"></td>');
    I could then use location.search to get the query string and treat the CSS as needed, but I still get a undefined value. So, maybe only HTTP URLs work with this.

    Any thoughts on this?

  2. #2
    SitePoint Addict Guimauve's Avatar
    Join Date
    Aug 2004
    Location
    Chicago
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mtjo
    Code:
    document.writeln('<td><img class="rteImage" src="' + imagesPath + 'bold.gif" width="25" height="24" alt="Bold" title="Bold" onClick="FormatText(\'' + rte + '\', \'bold\', \'\')?setBold=active"></td>');
    I could then use location.search to get the query string and treat the CSS as needed, but I still get a undefined value. So, maybe only HTTP URLs work with this.

    Any thoughts on this?
    The contents that you see in the onClick event is not a URL it is JavaScript, so forget the idea of using the QueryString.

    Charles


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
  •