• 1 reply
  • Latest Post - ‏2013-05-30T22:24:09Z by tmparker
5 Posts

Pinned topic Help with java script in subfile widget

‏2013-05-29T20:40:09Z |


in my widget subfile, i have this code :

 tr.setAttribute("ondblclick", "javascript:show_siav(" + pathFld.trim() + ")");

the string pathFld has this value ";D_:Tutti;PI_:P000100680;'"

this the Html code ondblclick="javascript:show_siav(";D_:Tutti;PI_:P000100680;")

and in this is the js function in lxgwfunctions.js

function show_siav(pathd ) {  // Test
        if(isKeySent) return;
     var pathd ;     
     alert ("Bottone " );
     alert ("pathd " + pathd);
     var pathdw = pathd ;
     var load = );

when i click on the row, nothing happend , the js function don't run, i don't see neither the alert js.

where i'm wrong ? can some one help me

thanks in advance

  • tmparker
    534 Posts

    Re: Help with java script in subfile widget


    If you code is exactly as you have it above then my guess is this is failing because you are using double quotes to surround your URL and you use double quotes to open the ondblclick command.

    I ran a simple test with this code and it works fine:

    <tr ondblclick="testDblClk('test string')" style="background-color: yellow"><td>double click row for alert</td></tr>

    Notice that I use single quotes inside the function call itself.