Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using variables in a frame source

Status
Not open for further replies.

cadocs

Technical User
Jun 16, 2005
35
US
I am trying to loan an ASP page in a hidden frame. The URL for the ASP page has a querystring attached to it, however the querystring has variables that i am getting from my javascript and so I can't reference the url reicetly in the "<frames src =" section becuase of the variable querystring.

Any ideas on how to reference a frame's URL with variables in it. I put my code below. Please note, the ASP page loads fine if the query variables are made static (i.e. written into the URL).

Any help would be apprecaited adn my code is below.

Geoff Soumakian




<script language="javascript">
var broswer_size_URL = " + myWidth + "&height=" + myHeight;



</script>

</head>

<frameset rows="100%,*,*">
<noframes><body><p>Your browser doesn't support frames</p></body></noframes>
<frame src="fibo.html"/>
<frame src="
<script type="text/javascript">
document.write('<frame src="' + broswer_size_URL + '"></frame>');
</script>



</frameset>

</html>
 

You would need to recreate the url and actually include the variables in your link.

From wherever it is they come from. Otherwise you would just be calling the url normally without any parameters.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
how can i recreate the URL? I am trying to load a URL with a querystring that changes based on the user's web browser settings.

 
Exactly how is it you know the user's web browser settings?

I would guess you would need to link to whatever script is obtaining the users settings so it builds the query string.

I'm not entirely sure I understand what it is you are trying to do.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
i have a main page that loads 3 frames. The first uses 100% of the window and the second and third frames use 0% or are hidden.

One of the hidden frames is an ASP page that uses ASP, VB and javascript to pull the information from the user's browser and saves them into javascript variables.

The variables are "myWidth" and "myHeight" and are used to create the variable "browser_size_URL".

I am trying to load that dynamic URL into the frame so that the ASP can save the browser's information into a database.

Does that better explain what I am trying to do?
 
Ahh so you are trying to get the JS variables to the ASP portion of the hidden frame?

Its very convoluted, but you could try the window.location function with the already built browser_url variable.


Code:
window.location=browser_size_URL;

This will change the hidden frames location to basically whatever locations pointed in your dynamic URL.

This is now a Javascript issue and as such falls outside the scope of this forum, so you can post here: forum216 for additional details on the usage of the window.location function.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
vacunita,

Thanks for the help. I think the major issue is that the <frame src="..."> will not take variables, javascript or otherwise.

If this is not true, then please let me know. What i am trying to do it get the browser window size of the MAIN frame from the hidden frame. If i try to pull the window size from the hidden window, it tells me the size is 0 x 0, which is true.

I also tried to reference the top frame through the child frame and my browser said "permission denied"

So what i did was just get the whole screen resolution from the hidden ASP page and loaded the static page into the frame, and of course that worked.

Thanks again!!!

Geoff
 
The frames src I believe should take parameters in the url, although i can't be certain.

Maybe someone else here knows for sure.

However this just points out why Frames are so difficult to work in. Maye you should think about restructuring your page so t doesn't use any frames. Do you really need the asp in a hidden frame

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
i would love not to use frames, what others ways are there around it without frames.

 
Well that depends on what you are doing. but I'm sure your asp doesn't need a separate frame to run in.


The same your javascript does in the frame it can do in the main window.

Its just a matter of how your program it. I'm sure though having a hidden frame running ASP and JS is really over-complicating things.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
How would you open an ASP page without putting it in into own frame?
 

What is the connection between an ASP page and frames? Why not show us what you want to achieve so we can show you how to do it without frames.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Hmmm....

You might get more help on forum216 . I'm sure I've read that [tt]document.write[/tt] doesn't work under some doctypes, the preferred method being DOM scripting to insert objects into pages, but I'm not a JS expert. I suggest you start by temporarily changing your frameset to make the third frames visible - then you can confirm whether it is appearing at all.

Incidentally, you don't need to use frames to do what you're doing. Instead of having your stats scripts return a blank web page and putting them in a frame, get them to return a 1 pixel image instead. That way you can put your calls in [tt]<img>[/tt] tags instead and dodge all the crappinesses of frames.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
John,

Basically, I am trying to track stats from different users that view the site. I am logging their browser window dimensions, browser version, flash version and other information.

The reason i thought i had to use a frame was becuse I am loggin this info into a database using an ASP page, so i have to somehow load the ASP page AND load the main website, and i don't particularly want the user to see the ASP page becuase it has no relevance to the site.

I could run all the JS and VB script on the main page, but i don't konw how i would go about loading the ASP page.

For testing purposes, i have the ASP page returning the data and this make the frame visible, however the main problem is that the frame will not load with any variables in the URL.

I would love to find a different way to load this up without frames, however i don't really undersnd putting them into an IMG tag or how i would save that info to a DB?

Thanks for your help.

Let me also clarify that i have produced a work-around that just shows total screen resoltion and not the browser window size becuase when i show the browser window size of the hidden frame it of course is 0 px by 0 px.


Thanks all!

Geoff
 
What we are trying to tell you is that there is no reason to separate your ASP from your Website.

ASP runs on the server, so the user will never actually see it. Once ASP is done it will deliver the page to the browser and run your JS and VbScripts normally.

If I where doing this, I would setup an opening page with the JS that gathers the information (this page doesn't need anything in it it can be blank) and when its done it then redirects to your final website which at the same time is an ASP page. It saves the info to DB and then displays your website.






----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Quite so - just what I was asking.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
ok, i understand where you are coming from.

Let me explain. I have my website running from an offsite hosting company and my ASP pages running on my server in the office. My database is local as well, so that is the difference.

I guess I'm happy with my work-around but thanks for the help!
 
Location is irrelevant. You could have your webpage come from your server at the office and the only thing on your hosting company would be JS page that gathers information, and then redirects.

Or better yet, if your web host supports ASP just have the ASP in the webpage connect to your database in the office.

In any case you seem to be doing things in the most difficult way possible.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
that apprears to be true : (

Thanks for your help none the less!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top