473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

iframe change params.

Hi,

A friend asked me if i could help him building a lilttle website.

Having 10 years of proffessional experiance in writing "non-webbased" code i
thought that will not be that hard.
I think here it went wrong.

The only thing he want to do is integrating an external provided iframe into
his website and make that multilingual using some little flags that he puts
at the top of his site.

This is the src iframe src="provideroftheframe.php?lang=en"

So when he clicks for example a spanish flag the param lang should change to
ES , the france flag to FR...

Is this possible using a javascript and if so can someone provide me a
solution ; this has to be done without server side technologie

Kind regards

J.




May 19 '07 #1
4 4233
VK
On May 19, 12:19 pm, "Jo Claes" <jcl...@skynet.bewrote:
This is the src iframe src="provideroftheframe.php?lang=en"

So when he clicks for example a spanish flag the param lang should change to
ES , the france flag to FR...
You don't need any Javascript for that, plain old HTML will suffice:

<iframe name="MyIFrame" src="provideroftheframe.php?lang=en">

<a href="provideroftheframe.php?lang=es" target="MyIFrame"><img
src="Spain.gif"></a>

May 19 '07 #2
Hi,

and what if you have two params fe.
provideroftheframe.php?lang=en&category=1
clicking flag will change the language and a dropdown list using the
category ?

Kind regards

"VK" <sc**********@yahoo.comwrote in message
news:11*********************@q75g2000hsh.googlegro ups.com...
On May 19, 12:19 pm, "Jo Claes" <jcl...@skynet.bewrote:
>This is the src iframe src="provideroftheframe.php?lang=en"

So when he clicks for example a spanish flag the param lang should change
to
ES , the france flag to FR...

You don't need any Javascript for that, plain old HTML will suffice:

<iframe name="MyIFrame" src="provideroftheframe.php?lang=en">

<a href="provideroftheframe.php?lang=es" target="MyIFrame"><img
src="Spain.gif"></a>

May 19 '07 #3
VK
On May 19, 1:07 pm, "Jo Claes" <jcl...@skynet.bewrote:
Hi,

and what if you have two params fe.
provideroftheframe.php?lang=en&category=1
clicking flag will change the language and a dropdown list using the
category ?
Then you have a different solution, obviously. The previous one has
been given for what you asked in the original post.

For more complicated situations you have to decide if:
a) all possible URL parameters can be stored in form controls.
b) URL parameters cannot be hardcoded but must be calculated client-
side depending on user input.

In case a) you still don't need any javascript:

<iframe name="MyIFRAME" src="provideroftheframe.php?lang=en">

<form target="MyIFRAME" method="GET" action="provideroftheframe.php">
<input type="text" name="lang" value="es">
<input type="text" name="category" value="1">
<input type="submit">
</form>

Obviously you can use any needed control types, text boxes are used
only for simplicity.

In case b) you need to query form controls for current values,
validate the input, make the needed calculations based on it, generate
URL string and assign iframe's window.href property to get new page.
An abstract description of all these operations would be effectively
equal to a set of posts with Javascript introductory lessons; thus if
the variant b) is your case then please post the entire page your are
working with with the exact explanation what form controls do you
want to use for URL generation and by what algorithm. A demonstration
of your initial attempt to solve the problem - even if failed - would
be also much appreciated.

May 19 '07 #4
ASM
Jo Claes a écrit :
>
The only thing he want to do is integrating an external provided iframe into
his website and make that multilingual using some little flags that he puts
at the top of his site.
<a href="myPage.html.en" target="myIframe">
<img src="en_flag.jpg" alt="english" title="english">
</a>
<a href="myPage.html.sp" target="myIframe">
<img src="sp_flag.jpg" alt="spanish" title="spanish">
</a>
<a href="myPage.html.fr" target="myIframe">
<img src="fr_flag.jpg" alt="french" title="french">
</a>
This is the src iframe src="provideroftheframe.php?lang=en"

So when he clicks for example a spanish flag the param lang should change to
ES , the france flag to FR...
Is this possible using a javascript and if so can someone provide me a
solution ; this has to be done without server side technologie
If really he uses php and variable to set language
and absolutly wants to be dependent of JS :

function country(flag) {
document.myIframe.location.href = 'provideroftheframe.php?lang='+flag;
}

<img src="en_flag.jpg" alt="english" onclick="country('en');">
<img src="sp_flag.jpg" alt="spanish" onclick="country('sp');">
<img src="fr_flag.jpg" alt="french" onclick="country('fr');>
or (better) :

function country(flag) {
document.myIframe.location.href = 'provideroftheframe.php?lang='+flag;
return false;
}

<a href="myPage.html.en" target="myIframe"
onclick="return country('en');">
<img src="en_flag.jpg" alt="english" title="english">
</a>
<a href="myPage.html.sp" target="myIframe"
onclick="return country('sp');">
<img src="sp_flag.jpg" alt="spanish" title="spanish">
</a>
<a href="myPage.html.fr" target="myIframe"
onclick="return country('fr');">
<img src="fr_flag.jpg" alt="french" title="french">
</a>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
May 21 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: google | last post by:
I have a HTML file that contains an iframe. The HTML file is served by one server. The iframe contains a link to a completely different server. My question is, can any action in the iframe (such...
4
by: Thomas | last post by:
Hi there, I have an iframe which is editable (designMode = "on") and want to resize it dynamically as the content grows (e.g. more lines of text is in there) and there the struggle starts. I...
1
by: Angelo | last post by:
I'm trying to use iframe to create a menu for a bunch of pages - only I'd like the menu to change slightly (a highlight) depending on what page it's being displayed in. <iframe name="menu"...
3
by: Russell | last post by:
I have a quirky issue that I believe involves timing and only 2 hairs left to pull. I have a modal dialog that is an IFrame. The IFrame contains another window - which contains the appropriate...
4
by: Jaco | last post by:
Hey, Maybe I am in the wrong newsgroup. I am writing an browserapplication. In the webpage I have 2 parts a fixed part and a variable part. The variable part is an IFRAME. If I press a button in...
1
by: Jac | last post by:
Aspx-problem : I want to write code (C-sharp) behind a button, that determines on some criteria which webpage an IFRAME has to show. To change a normal webpage you do a redirect in c-scharp...
0
by: tequilamala | last post by:
I have an Iframe in one of the pages i am developing... the iframe is suppose to scroll up and down and the links target the iframe. the problem is that the iframe scrolls side to side on internet...
1
by: Bob | last post by:
When I move an IFRAME page back to 'top.location' ( eg with some javascript in the page : if (top !=self) top.location=self.location; ) it appears to be losing the contents of REQUEST.PARAMS. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.