Topic
1 reply Latest Post - ‏2013-05-30T22:24:09Z by tmparker
giocot
giocot
5 Posts
ACCEPTED ANSWER

Pinned topic Help with java script in subfile widget

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

Hi

in my widget subfile, i have this code :

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

the string pathFld has this value "http://192.168.0.228/weblink/cmd_arrive.asp?CMD=A_:Generale;D_:Tutti;PI_:P000100680;'"

this the Html code ondblclick="javascript:show_siav("http://192.168.0.228/weblink/cmd_arrive.asp?CMD=A_:Generale;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 = window.open(pathdw );

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
    tmparker
    484 Posts
    ACCEPTED ANSWER

    Re: Help with java script in subfile widget

    ‏2013-05-30T22:24:09Z  in response to giocot

    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.

    Thanks

    Tim