www.webdeveloper.com
Results 1 to 3 of 3

Thread: How to get access a object of a website using javascript?

  1. #1
    Join Date
    Nov 2013
    Posts
    4

    How to get access a object of a website using javascript?

    Hello, guys! I'm newbie in javascript and i would like to make a simple script that inserts a single word in the google's search field. To start, i made a simple html page as you can see below.
    Code:
    <html>
    <head>
    <title>Page 2</title>
    </head>
    <body>
    
    <form name="robgeek">
    	Username: <input type="text" name="username"/>
    	Password: <input type="password" name="password"/>
    	<input type="submit" value="Submit!">
    </form>
    
    <script type="text/javascript">
    
    	//Here i can access the robgeek form and manipulate "username", "password" and "submit".
    	document.write(document.robgeek.username.name);
    
    </script>
    </body>
    </html>
    Considering this simple webpage as if were google: How can i make a javascript to access those fields, like "Username" and "Password"? I believe i could do the same thing with Google or really make a javascript to access for me my email.
    I know how to get access in those fields but only in the same code, like you can see above. But i don't know how to get access and fill those field with a script only for this task. The following code is what i did. I considered the webpage above as a website, and i tried to get access with my following javascript. But i don't know what to do now!
    Could you guys help me?
    Code:
    <html>
    <head> 
    </head>
    <body>
    
    	<a href="#" onclick="window.open('file:///home/rob/index2.html');">Link here!</a>
    
    <script type="text/javascript">
    	//I don't know what to put here!
    </script>
    
    </body>
    </html>
    Thank you!

  2. #2
    Join Date
    Nov 2013
    Posts
    4
    Sorry post here. I would like to edit my original post but i don't know how to do it.
    I'll try again tell you what i would like do more clearly.

    A friend of mine are using a javascript to download all images from a website. I would like to do similar things, not exactly the same thing, but similar things and i have to start for somewhere, right?

    First thing to do, once i already have the basic knowledge about javascript is learn how to communicate with a website and access his code using javascript. After that i believe i need to learn how to identify objects in this code, something like "getElementById", i believe. An finally learn how to interact with this object.

  3. #3
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,674

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles