Anyway loading the page without showing it?

B

benny

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 ;)
 
R

Randy Webb

benny said:
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.
 
F

Fred Oz

benny said:
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.
 
K

kuok benny

Fred said:
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.
 
R

Randy Webb

kuok said:
loading an HTML page for the sole purpose of



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>
 
K

kuok benny

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 ;-)
 
R

Randy Webb

kuok said:
Randy wrote:-


<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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top