Generic Window Usage

This is a discussion on "Generic Window Usage" within the JavaScript Forum section. This forum, and the thread "Generic Window Usage are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 2nd, 2006, 20:40
Junior Member
Join Date: Jun 2006
Location: England
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Generic Window Usage

Hi,

This is my first post so I apologise if im not sticking to any standard etc.

Im building a site to display pictures with text. Originally, I will show thumbnails, when clicked on, I currently use Javascript to blow up the picture to full screen size. Only problem I have here is that I cant show any text with it or description.

Im trying to use Getvar to read the URL. What I plan to do is link to a generic page that has an image on there. When I call this URL, I will place in the URL the image file (test.gif) which will then get loaded. Is this possible?

Also, I read that I can only have 4096bytes in the URL, so how could I show the descriptive text to go with the image?

What I dont want to do is create 50 more or less duplicate pages.

Thanks.
Reply With Quote

  #2 (permalink)  
Old Jun 2nd, 2006, 21:21
Junior Member
Join Date: Jun 2006
Location: England
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Generic Window Usage

I have found this:

Code: Select all
 
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body onload=getVars()>
<p> 
  <script language="javascript">
function GetVars( def ) 
{
    this._def_ = def;
    var query, queries = top.location.search.substring(1).split( /\&/ );
    for ( var i=0; (query = queries[ i ]); i++ )
    {
        query = query.split( /\=/ );
        this[query[0]] = ( typeof query[1] == 'undefined' ) ? def : unescape(query[1]).replace( /\+/g, " " );
    }
}
GetVars.prototype.exists = function( key )
{
    return ( typeof this[key] != 'undefined' );
}
GetVars.prototype.assign = function( key )
{
    return ( this.exists( key ) ) ? this[key] : this._def_;
}
var _GET = new GetVars( '' );
var num1 = _GET.assign( 'n1' );
var num2 = _GET.assign( 'n2' );
var num3 = _GET.assign( 'n3' );
document.write(num1);
</script>
<p>&nbsp;
<p><img width="203" height="128" name="slide2" src="xleft.gif"> 
</body>
</html>
Which reads the addess variables, but can I load an image using a variabled?

Ie <IMG = num1> ???? Cant get this to work.
Reply With Quote
Reply

Tags
generic, window, usage

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Usage alexgeek Other Programming Languages 11 Dec 17th, 2007 03:28
Making duplicate code generic Rudie Web Page Design 27 Jul 15th, 2006 20:27
bandwidth usage and mysql sing2trees Hosting & Domains 1 Jan 14th, 2006 11:44
General question about your DB usage RaptorRex Databases 1 Aug 27th, 2005 08:29


All times are GMT. The time now is 10:55.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43