Results 1 to 4 of 4

Thread: Textual tooltip Script

  1. #1
    Join Date
    Nov 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Textual tooltip Script

    Textual tooltip Script
    http://www.dynamicdrive.com/dynamicindex5/linkinfo.htm


    Hi I'm a new in all stuff of javascript so be patient with me......................My problem is tha I put dinamically text inside de var content=''"...............And I want to call some event handler inside(ONCLIK EVENT).....like if I want to put links inside the content when a click the link a window opens..........but I can't..........Some ideas to do this ???............

    example

    <script>
    /*<cfoutput query="ShowPrices">*/
    content[#ShowPrices.currentrow#]='* <a href="#" onClick="MM_openBrWindow('window.cfm?file=#SESSION.Cat#','1','width=760,height=520')"> Details</a>'
    /*</cfoutput>*/
    </script>

    HELP ME PLEASE!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Whenever you have something like this:

    Code:
    arrayName[0]='<a href="some.htm" onclick="alert('You clicked me!')">Click Me</a>'
    It will throw an error because single quotes (') are used to delimit the array element and the text for the alert within said element. it should look like this:

    Code:
    arrayName[0]='<a href="some.htm" onclick="alert(\'You clicked me!\')">Click Me</a>'
    with the contained delimiters escaped using a downslash (\).

    Getting back to your example, if everything else is correct and a downslash will present no problem to the PHP or whatever other code it is you are using in there besides javascript, simply applying the same technique there will solve the problem:

    Code:
    <script>
    /*<cfoutput query="ShowPrices">*/
    content[#ShowPrices.currentrow#]='* <a href="#" onClick="MM_openBrWindow(\'window.cfm?file=#SESSION.Cat#\',\'1\',\'width=760,height=520\')"> Details</a>'
    /*</cfoutput>*/
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thank you very much it works !!!!

    Thanks for the advice, its really work! ............

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by John
    PHP or whatever other code it is you are using in there besides javascript
    ColdFusion Hence "cfoutput."
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •