We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9814
    • 8 Posts
    Hello everyone! I am using this script: http://dynamicdrive.com/dynamicindex5/dhtmltooltip2.htm

    and I am modifying a part of the dropdown menu snippet to add the onmouseover bits to the appropriate links. This is what I am adding:

    onMouseover="ddrivetip(’JavaScriptKit.com JavaScript tutorials’, 300)";
    onMouseout="hideddrivetip()"


    When I add the code, my site gives me this error:

    Parse error: syntax error, unexpected T_STRING in /home/prettyfl/public_html/manager/includes/document.parser.class.inc.php(691) : eval()'d code on line 234




    I am pretty sure that error is having saying that modx is having a hard time reading/parsing what I’m trying to get it to do. Does anyone know how to rewrite that to work on my menu? I don’t have much knowledge when it comes to php parse errors tongue

    If someone can get this to work for me, I’ll definitely post this as a tutorial! It’ll be really cool looking if modx could use it.
      • 32241
      • 1,495 Posts
      Notice this code
      onMouseover="ddrivetip('JavaScriptKit.com JavaScript tutorials', 300)";


      It contains both single quote and double quote. I believe in dropmenu snippet, it’s using either one of this to encapsulate the string. So you need to excape either the double quote or single quote with blackslash like this \’ or \", but it’s all depends on which type of quote being use by the dropdown snippet that you modified.

      Sincerely,
        Wendy Novianto
        [font=Verdana]PT DJAMOER Technology Media
        [font=Verdana]Xituz Media
        • 9814
        • 8 Posts
        This is one of the lines I’m trying to put it in:

        ’<a href="[~’.$child[’id’].’~]" title="’.$child[$titleOfLinks].’" RIGHT HERE>’.$pre.$child[$textOfLinks].$post.’</a>’;

        I’m gonna try that escape thingy


        edit: this is frustrating! I escape certain parts, and I get errors, then I escape too much and nothing happens, all I see are the links lol

        hmmm, I am having a hard time fixing it to be xhtml valid...

        edit again! FINALLY! it works lol: you can see it being used here: http://prettyflesh.com/index.php Just hover over one of the menu links!
          • 32241
          • 1,495 Posts
          Cool,

          Glad to know that you solve the problem.
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media