How execute Javascript code for other websites

Discussion in 'JavaScript' started by vaibhavsingh1986, Apr 23, 2009.

  1. #1
    I have my Javascript code by which I can find the properties of components in a webpage. When I do CTRL + click on any button or link or text box I can get the properties like the name,id, values etc of that component.

    But I want to find out the properties of component of any web page I open in browser. eg. I open http://www.google.com then I should be able to find out the property of the components on that page.

    My question is that how to execute my Javascript for other websites and their webpages.

    Can this be done.. Please help I need some guidance in doing this task..
     
    vaibhavsingh1986, Apr 23, 2009 IP
  2. joep1978

    joep1978 Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use Firebug, surf to the webpage and add your Javascript to the Script tab.

    Then call whatever function you want by typing javascript:functionName(); into the browser location bar
     
    joep1978, Apr 24, 2009 IP
  3. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #3
    Or, you can just use Firefox with the Webdeveloper Toolbar installed - gives you complete access to CSS for each element, the values, IDs etc. etc.
     
    PoPSiCLe, Apr 25, 2009 IP
  4. Jordanlw

    Jordanlw Peon

    Messages:
    13
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    So does Firebug.
     
    Jordanlw, Apr 25, 2009 IP
  5. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #5
    Indeed. I still prefer the toolbar if I'm gonna chose one - although the best would be to use both :D Since the toolbar has very simple access for dealing with sessions and cookies, the ability to disable several different elements, check the validity of html and css etc. etc. by the click of a button (or chosing from a list).
     
    PoPSiCLe, Apr 25, 2009 IP
  6. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #6
    webdev toolbar is better / easier for dom walking/inspection with regards to styling/css. press ctrl-shift-f or ctrl-shift-y then click on any element.
     
    dimitar christoff, Apr 26, 2009 IP