locked
Help to Inject Javascript through VFP RRS feed

  • Question

  • Dear All,

    I am doing website automation, I want to inject my own javascript function in to that web site, basically i want to call jquery change event through com object.. after long search i found that is not possible, so i have to inject javascript code. In javascript we have to call textbox change event. Kindly give sample to how to inject javascript through foxpro. Any other Javascript injection also ok..

    thanks in advance for your help.

    Regards

    RAM

    Thursday, August 12, 2010 5:45 PM

Answers

  • With your browser control or ie application:

    cJsSource=filetostr('myjsfile.js')

    with this.document 

        jselement = .createelement('Script')

        jselement.type='text/javascript'
        jselement.text = cJsSource
        jselement.id='vfpJsScript' && optional

        .getelementsbytagname("head").item(0).appendchild(jselement)

    endwith


    Marco Plaza



    Wednesday, July 4, 2012 12:22 AM

All replies

  • Is this still an issue?

    Thanks!


    Ed Price (a.k.a User Ed), SQL Server Experience Program Manager (Blog, Twitter, Wiki)

    Tuesday, July 3, 2012 12:00 AM
  • Even if he's not interested anymore, others my be .. like me. I've arrived to this webpage via google because of his question.

    So please kindly post an answer and maybe an example  :)

    Thanks!

    Tuesday, July 3, 2012 8:26 PM
  • With your browser control or ie application:

    cJsSource=filetostr('myjsfile.js')

    with this.document 

        jselement = .createelement('Script')

        jselement.type='text/javascript'
        jselement.text = cJsSource
        jselement.id='vfpJsScript' && optional

        .getelementsbytagname("head").item(0).appendchild(jselement)

    endwith


    Marco Plaza



    Wednesday, July 4, 2012 12:22 AM