JavaScript on .bat file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Almog1246
    New Member
    • Mar 2012
    • 4

    JavaScript on .bat file

    Hello, I'm trying to build a file, that will Pops up automatically ad's on some web site;

    this is what im trying to do
    Code:
    start "~\chrome.exe" javascript:location.href='/MyYad2/MyOrder/CartradeDetails.php?CarID=720724&Up=u
    The problem it does not work, would love if someone would help me Thanks in advance. :)
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    If you want to launch a browser window then use the Desktop class: http://docs.oracle.com/javase/6/docs...ava.net.URI%29

    Comment

    • Almog1246
      New Member
      • Mar 2012
      • 4

      #3
      what should i do ? :?

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Are you working in Java (this is a Java forum)?

        Comment

        • Almog1246
          New Member
          • Mar 2012
          • 4

          #5
          im not working in java but be happy if you will help me

          Comment

          • Claus Mygind
            Contributor
            • Mar 2008
            • 571

            #6
            You are going about it the wrong way.

            First as stated by others here already, you need to post your question in the javaScript forum instead of here in the Java forum.

            Second you would not use a .bat file to pop up an ad. You would build in your code an ajax call that will make a call back to the web server after the HTML page has loaded on the user's computer.

            I suppose if you wanted to track the user's interest to determine what kind of ad to display on their computer, you may have to use cookies, to see what other sites they have visited. But at this time that seems above your skill level.

            So in the <body> tag add "onload = yourAdCall()". Then either in your javaScript section of the HTML header or in the linked .js file create your ajax call, which will return your ad to the user.

            Comment

            Working...