Anyway loading the page without showing it?

Discussion in 'Javascript' started by benny, Oct 12, 2004.

  1. benny

    benny Guest

    Hi,

    I have a web pageA, that include the javascript, to do some onload
    event so that it would load another web pageB to perform some onload
    action.
    Could I able to load the pageB without showing it ? Or while loading
    pageA I would load the pageB onload event using javascript?
    I have one method i.e. <body onload="window.open("www.try.com",
    height=0, ... )>
    but once I have popup-blocker on browser I wont be able to achive that
    action.
    Anyone could give me suggestion ?

    regards

    benny ;)
    benny, Oct 12, 2004
    #1
    1. Advertising

  2. benny

    Randy Webb Guest

    benny wrote:

    > Hi,
    >
    > I have a web pageA, that include the javascript, to do some onload
    > event so that it would load another web pageB to perform some onload
    > action.
    > Could I able to load the pageB without showing it ? Or while loading
    > pageA I would load the pageB onload event using javascript?
    > I have one method i.e. <body onload="window.open("www.try.com",
    > height=0, ... )>
    > but once I have popup-blocker on browser I wont be able to achive that
    > action.
    > Anyone could give me suggestion ?


    Load PageB in a hidden IFrame.


    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Oct 12, 2004
    #2
    1. Advertising

  3. benny

    Fred Oz Guest

    benny wrote:

    > Hi,
    >
    > I have a web pageA, that include the javascript, to do some onload
    > event so that it would load another web pageB to perform some onload
    > action.


    If all you want is to access a function, why not put it into a JS file
    and call it directly? Unless the page you are trying to access isn't
    yours....

    > Could I able to load the pageB without showing it ?


    Yes, the trivial case:

    <body style="display: none;">

    But then you end up with an empty window and are still defeated by
    pop-up blockers.

    > pageA I would load the pageB onload event using javascript?
    > I have one method i.e. <body onload="window.open("www.try.com",
    > height=0, ... )>


    Again, put the function into a JS file, then the same code is avaialble
    to both pages. I'm struggling with the concept of loading an HTML page
    for the sole purpose of running a JavaScript function.

    Perhaps I am missing the point of what you are trying to do...


    Cheers, Fred.
    Fred Oz, Oct 12, 2004
    #3
  4. benny

    kuok benny Guest

    Fred Oz wrote:
    > Again, put the function into a JS file, then the same
    > code is available to both pages. I'm struggling with the > concept of

    loading an HTML page for the sole purpose of
    > running a JavaScript function.


    Your suggestion is good. However, multiple functions or procedure I
    wrote are on the pageB.
    Basically, I need to wrote a javascript that could call
    pageB' function or procedure(not using javascript) rather than wrote
    another set of functions in javascript on pageA.
    My idea is to load the pageB's functions or procedures on pageA by using
    sth like onload event on pageA.






    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    kuok benny, Oct 13, 2004
    #4
  5. benny

    Randy Webb Guest

    kuok benny wrote:
    > Fred Oz wrote:
    >
    >> Again, put the function into a JS file, then the same
    >>code is available to both pages. I'm struggling with the > concept of

    >
    > loading an HTML page for the sole purpose of
    >
    >>running a JavaScript function.

    >
    >
    > Your suggestion is good. However, multiple functions or procedure I
    > wrote are on the pageB.
    > Basically, I need to wrote a javascript that could call
    > pageB' function or procedure(not using javascript) rather than wrote
    > another set of functions in javascript on pageA.
    > My idea is to load the pageB's functions or procedures on pageA by using
    > sth like onload event on pageA.


    To repeat what Fred said, and I don't think you understood.

    Take the script that is in pageB, put it into an external .js file, then
    include it in both pages:

    <script type="text/javascript" src="myJSCode.js"></script>

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Oct 13, 2004
    #5
  6. benny

    kuok benny Guest

    Randy wrote:-
    > Take the script that is in pageB, put it into an
    > external .js file, then
    > include it in both pages:

    <script type="text/javascript" src="myJSCode.js"></script>

    Hi,

    let say I put the
    <script type="text/javascript" src="myJSCode.js"></script> on page
    e.g.http://www.channel.com/main.php. My question is inside myJSCode.js,
    anyway to wrote the function for me to redirect to another url e.g.
    http://www.visitme.com/visit.aspx?visit=1 such that this process would
    pass parameter value to page http://www.visitme.com/visit.aspx without
    loading the page http://www.visitme.com/visit.aspx itself ?

    Thanks in advance.

    regards,

    benny ;-)


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    kuok benny, Oct 13, 2004
    #6
  7. benny

    Randy Webb Guest

    kuok benny wrote:

    > Randy wrote:-
    >
    >>Take the script that is in pageB, put it into an
    >>external .js file, then
    >> include it in both pages:

    >
    > <script type="text/javascript" src="myJSCode.js"></script>
    >
    > Hi,
    >
    > let say I put the
    > <script type="text/javascript" src="myJSCode.js"></script> on page
    > e.g.http://www.channel.com/main.php. My question is inside myJSCode.js,
    > anyway to wrote the function for me to redirect to another url e.g.
    > http://www.visitme.com/visit.aspx?visit=1 such that this process would
    > pass parameter value to page http://www.visitme.com/visit.aspx without
    > loading the page http://www.visitme.com/visit.aspx itself ?


    No. Because to initiate visit.aspx, you *must* request it from the
    server. That means you "load" it. Whether in a hidden frame, or via an
    HTTPRequest Object, hidden IFrame, or however, you must load it.


    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Oct 13, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ZMan
    Replies:
    2
    Views:
    621
  2. Milsnips
    Replies:
    1
    Views:
    564
    =?Utf-8?B?Z3VpbGxhdW1lIFN0RXRpZW5uZSBGUg==?=
    May 16, 2005
  3. Ray Booysen
    Replies:
    2
    Views:
    645
    Ray Booysen
    Mar 28, 2006
  4. Paul
    Replies:
    2
    Views:
    271
  5. Jonathan Wood
    Replies:
    10
    Views:
    540
    Jonathan Wood
    Jan 3, 2009
Loading...

Share This Page