1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to run JavaScript for HTTP Web Request ?

Discussion in 'Visual Basic .NET' started by carmamir, May 4, 2014.

  1. carmamir

    carmamir Junior Member

    Joined:
    May 8, 2011
    Messages:
    118
    Likes Received:
    9
    Location:
    UK
    I know how to get result of JS Window.OnLoad, but I have no idea how to run any other functions which running on POST method.

    Example

    Code:
    script type="text/javascript">//<![CDATA[
    replaceFormAction('form_post', dF('lxxt%297E%296J%296Jtmiv4hspsriospe2fpsk1644%3D2gsq%296Jehqmr2tlt%297Jgxvp%297Htswxw%296%3Axef%297Hihmx%296%3Afpsk%297H5','23'));addHiddenFields('form_post', {'auth[]':[['99g78g%3D%3Bkj8%3Bg%3E%3Ej6l%3C8ih6j8i%3E%63A%3C%3B%3A%3D',42],['9%40B%93D%3D%3B%3F%409%3C9Akmmj%3Com9nA%3Bj%3F%3Cl%3EABkl',6]]});//]]></script>
    
    
    And the result is:
    Code:
    [TABLE]
    [TR]
    [TD]33a12a75ed25a88d0f62cb0d2c846547
    [/TD]
    [/TR]
    [/TABLE]
    
    [TABLE]
    [TR]
    [TD]079442670308bdda3fd0e82a63c589bc[/TD]
    [/TR]
    [/TABLE]
    
    
     
  2. innosoft

    innosoft Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 25, 2008
    Messages:
    1,633
    Likes Received:
    639
    Occupation:
    Software Developer, SEO
    Location:
    Office
    Home Page:
    well its big pain in ass as far as i know.
     
  3. carmamir

    carmamir Junior Member

    Joined:
    May 8, 2011
    Messages:
    118
    Likes Received:
    9
    Location:
    UK

    It is, but it is possible, that's why I'm asking for other methods beside using JS host.

    This code is executed only after post button is clicked so I don't know how to catch result of JS execution.

    At this moment to run any JS I'm using host and then I can fetch result, but not in this case I know about other wrappers and I'm interested if any one here is using them and can recommend something ?
     
  4. carmamir

    carmamir Junior Member

    Joined:
    May 8, 2011
    Messages:
    118
    Likes Received:
    9
    Location:
    UK
    Ok issue solved. It turned out that JS function were using some other JS scripts embedded into file. Problem were lying in relative paths to those scripts :).
    Solution, remember to provide always absolute links to all JS scripts you want to run :)
    I've lost on this 2 days !
     
  5. innosoft

    innosoft Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 25, 2008
    Messages:
    1,633
    Likes Received:
    639
    Occupation:
    Software Developer, SEO
    Location:
    Office
    Home Page:
    can you post your code?
     
  6. zohar

    zohar Newbie

    Joined:
    Jun 24, 2014
    Messages:
    44
    Likes Received:
    5
    This is a weird post, HTTPWebRequest is just a socket connection to port 80 or 443 (https). There is no such thing as running Javascript there, you need the Scripting Host ActiveX object or a WebBrowser control for these things..
     
  7. littleslamanader

    littleslamanader Registered Member

    Joined:
    Oct 17, 2015
    Messages:
    95
    Likes Received:
    9
    It is difficult but I have a solution for you. You customized or designed your server by yourself but if it doesn't work then I have a code for this issue but can't post here.