How to paste net4 data into a third party web page (yahoo page)

Posted on 2012-08-27
Last Modified: 2013-11-20
I have a net4 application that has a session variable (it is a stock symbol).

What I want to be able to do is open , paste the session variable into the “yahoo enter symbol” field, and click the “get quotes” button.

I think I am looking for javascript code to do this.  I do not know javascript, but it seems to me the tasks are to

Open yahoo window
Identify yahoo control to paste net4 session variable
Paste the variable
Identify get quotes button
Click the button

Any suggestions?


Question by:williecg
    LVL 34

    Expert Comment

    It will make a difference what programming language is used for the session variable, since Javascript cannot read session variables. The programming language (PHP, ASP.Net, etc...) has to provide the session variable to Javascript.

    Once Javascript has it, this is easy using the Javascript command and the direct stock lookup URL. The reference is here:

    Here's an example of how you would use it:

    <script type="text/javascript">
    // An example of calling the function for ORCL stock symbol:
    // The function to open the window
    function showYahooFinanceFor(stock)

    Open in new window

    I would suggest that you expand the zones of this question to include the programming language that you're using on the server.

    Author Comment

    Thanks I will expand to include net4.

    The example I gave was an illustration.  The steps I outlined are what I need to know:  open window, find input field on webpage, enter data, find go button, click go button. is the window to open
    paste  151601000001700  into the geo number blank.
    click the search button

    url variables are not an option.

    LVL 34

    Accepted Solution

    If URL variables are not an option, then I'm afraid you're out of luck unless your application resides on a subdomain of What you're describing is cross-site scripting and it's specifically and explicitly locked down by every major browser because of the security problems it opens up.

    If your application IS on a subdomain of that, then you can set up a bit of script on both sides to allow this to happen, but it requires changes on both sides.

    Trying to access the HTML DOM of a remote domain using Javascript will result in access denied errors in your Javascript console, and there's really no good way around it.
    LVL 42

    Expert Comment

    by:Rob Jurd, EE MVE
    I've requested that this question be deleted for the following reason:

    The question has either no comments or not enough useful information to be called an "answer".
    LVL 34

    Expert Comment

    There is an answer here, but the answer is that you cannot do it in the way that the asker is requesting. Unfortunately, it's just standard browser security policy.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Aspnet xml 2 27
    Create and populate iFrame onClick of a button? 1 22
    Xamarin 10 19
    jQuery-Validation-Engine button onclick problem 13 16
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now