Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New Coder
    Join Date
    Aug 2010
    Posts
    39
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Bilingual site with iframe issues

    Hi,

    1- I have 2 index files (parent) which contain an iframe each. The purpose of the index file is to provide a static template, a frame, for a title bar, navigation and footer. One index file is in French, the other in English (index-e, and index-f) in two disctinct folders.

    2- I created several html files (in connection with the menu topics in the navigation bar) to be loaded and targeted at the iframe within the index file.

    I need to be able to switch the iframe content from topic to topic (which is easy) AND from french to English for the same topic, at the push of a button.

    The issue I have is this: if I put that button on the navigation bar, it will only switch language at navigation bar level (i.e the index file). If I put that button within each html file fed to the iframe, content will switch language but the navigation bar in the index will not follow.

    In other words, if I switch topic within the same language, it works fine, but if I switch language for a specific topic, I cannot get the index file to switch language too. Do you understand?

    I am looking for a way to let the browser know that a topic is now in a french, for instance, and the iframe content must be loaded in the french index file rather than the english one. It seems I will need some programming to achieve the result I want and I am a beginner javascript programmer. Before I get the know-how to approach such case instinctively and effectively, it will take a while. Any simpler workaround or javascript code I could insert in the index files and/or the html files fed to the iframe?

    Please do not suggest php, or ssi as they are not viable options with the server I use. At least not for now...

    Regards,

    The Apprentice

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    You just need a way to "remember" what URL the <iframe> is displaying so that when you change the index file it will reload the right URL into the <iframe>.

    It's not too hard...show the code you are using to change the URLs now (easier to show you how to mod the code than write from scratch).
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Aug 2010
    Posts
    39
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Old Pennant,

    Thanks for caring and sorry for the late reply. Been busy. But here's the code:

    Here's the English index file. The French one has the exact same layout.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
    
    <head>
    
    <title>Reference Tools</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <!--[if lt IE 7]>
    <script type="text/javascript" src="../js/jquery/jquery.js"></script>
    <script type="text/javascript" src="../js/jquery/jquery.dropdown.js"></script>
    <![endif]-->
    
    <link rel="stylesheet" type="text/css" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/css/dropdown/dropDownLayOut.css" />
    <link rel="stylesheet" type="text/css" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/CSS/dropdown/dropDownStyles.css" />
    <link rel="stylesheet" type="text/css" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/CSS/button.css" />
    <link rel="stylesheet" type="text/css" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/CSS/indexLayOut.css" />
    </head>
    
    <body>
    
    <div id="container">
    	<div id="masthead">
    	<table style="width: 860px; height: 74px">
    		<tr>
    			<td valign="top" style="width: 69px">
    			<img src="../IMAGES/logo.gif"/></td>
    			<td><h2>Office of the Law Clerk and Parliamentary Counsel</h2></td>
    		</tr>
    	</table>
    		</div>
    
    	<div id="top_nav">
    	<div id = "button">
    		<a href= "file://///HOC/AdminPrivate/FS08U/TurgeL/Documents/Site Web/francais/Index-f.htm">Français</a></div>
    
    		<!-- navigation -->	
    		
    		<ul class="dropdown dropdown-horizontal center">
    			<!-- Home -->
    			<li><a target="content" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/home/home.html">
    			Home</a>
    <!-- Publications -->			
    			<li class="dir">
    			<a target="content" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/publications.html">
    	
    
    
    // ...  I spare you this part. It is the rest of the navigation menu on top and end with the div tag that follows...		
    				
    	</div>
    	<div id="page_content">
    	<iframe name="content" id="language" style="width: 788px; height: 742px" frameborder="0" src="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/home/home.html">
    				Your browser does not support inline frames or is currently configured not to display inline frames.
    			</iframe>
    	<!-- end of page content div -->
    	</div>
    	<div id="footer">
    	<!-- end of footer div-->
    	</div>
    	
    <!-- end of container div -->
    </div>
    
    </body>
    
    </html>
    Now here's a typical content file. All the other content files are laid out identically:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <link rel="stylesheet" type="text/css" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/CSS/contentLayOut.css" />
    <link rel="stylesheet" type="text/css" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/CSS/contentStyles.css" />
    
    </head>
    
    <body>
    
    <h1>Home</h1>
    
    <p>My first paragraph.</p>
    
    </body>
    </html>

    Remember, I have the same set up for the French version which is located in another folder. Ideally I want the button which switches language in the the two index files and I need JavaScript to recognize the English/French content file and supply the French/English matching content file.

    All I am able to achieve so far is to send the user back to the other language index file when language is switched.

    If you just could give me the code and tell me where to paste, that would be awesome and good tutorial for me to learn from. Let me know if you need a printscreen too. I'm crossing my fingers for a quick reply.

    Thanks!

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    Okay, this is *UNTESTED*. When I get a chance, hopefully tonight, I'll actually try to find a way to test it.

    I only show the changed parts:
    Code:
    <script type="text/javascript">
    function setFrame( )
    {
        if ( location.search.length > 1 )
        {
            var frameurl = unescape(location.search.substring(1));
            // this line for the English index page:
            frameurl = frameurl.replace( /francais/ig, "english" );
            // this line for the French index page: 
            frameurl = frameurl.replace( /english/ig, "francais" );
            document.getElementById("language").src = frameurl;
        }
    } 
    </head>
    
    <body onload="setFrame();">
    ...
    	<div id = "button">
    		<a href= "file://///HOC/AdminPrivate/FS08U/TurgeL/Documents/Site Web/francais/Index-f.htm"
                       onclick="this.href += '?' + escape(document.getElementById('language').src); return true;">Français</a></div>
    
    		<!-- navigation -->
    How it works: When you click on the "Francais" link, we get the URL of the <iframe> from the ".src" attribute of the iframe and append that, after a "?" character, to the URL in the HREF of the <a> link. Then allow the <a> to proceed.

    When you get to the French index page, after the page is loaded (that is, when body onload= is triggered), we look to see if there *IS* a querystring (something after the "?" in the URL of the page). If there is, then we get that string (which will be the URL for the English iframe contents and change the path from ".../english/..." to ".../french/..." and then reload the iframe.

    It sounds good in theory. Let's see if it works in practice.
    Last edited by Old Pedant; 09-03-2010 at 12:47 AM.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    New Coder
    Join Date
    Aug 2010
    Posts
    39
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Unhappy

    Old Pedant,

    Thanks you so much for your input. Very appreciated. However, I am getting a blank page. I reviewed your code for typos but did not find any. What could explain this?

    Standing by,

    Cheers

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    Okay...there are a couple of hacks in here to make it work with both MSIE and FF, but it *does* work.

    Code:
    <html>
    <head>
    <title>This is the ENGLISH page</title>
    <script type="text/javascript">
    var frameLink = "file://c:\\test\\english\\page1.html"
    
    function changeFrame(link)
    {
        document.getElementById("language").src = link.href;
        frameLink = link.href;
        return false;
    }
    function setFrame( )
    {
        if ( location.search.length > 1 )
        {
            var frameurl = unescape(location.search.substring(1));
            // this line for the English index page:
            frameurl = frameurl.replace( /francais/ig, "english" );
            // this line for the French index page: 
            // frameurl = frameurl.replace( /english/ig, "francais" );
            document.getElementById("language").src = frameurl;
            frameLink = frameurl;
        }
    } 
    </script>
    </head>
    
    <body onload="setFrame();">
        <a href="file://c:\test\francais\index.html"
           onclick="this.href += '?' + escape(frameLink); return true;">Français</a>
    <hr>
    <a href="file://c:\test\english\page1.html" onclick="return changeFrame(this);">Page 1</a>
    <a href="file://c:\test\english\page2.html" onClick="return changeFrame(this);">Page 2</a>
    <hr>
    <iframe id="language" style="width:100%; height:300px;" src="file://c:\test\english\page1.html"></iframe>
    </body>
    </html>
    MSIE actuallly was easier than FF on this one, but they each had and oddity or two.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #7
    New Coder
    Join Date
    Aug 2010
    Posts
    39
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Old Pedant,

    We get the picture back now but still not working. I attempted to fill in the code you provided without success.

    Here's my English index page code in full. Could you kindly show me exactly where to fill in the code? I am also trying to provide you with print screens and folder structure. Check them out. It will give you a better idea of what I am trying to achieve.

    Do not forsake me, we will prevail!

    Here's the English index page code with default home.html in the iframe:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
    
    <head>
    <title>Reference Tools</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--[if lt IE 7]>
    <script type="text/javascript" src="../js/jquery/jquery.js"></script>
    <script type="text/javascript" src="../js/jquery/jquery.dropdown.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../CSS/main.css" />
    <link rel="stylesheet" type="text/css" href="../css/dropdown/dropDownLayOut.css" />
    <link rel="stylesheet" type="text/css" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/CSS/dropdown/dropDownStyles.css" />
    
    <script type="text/javascript">
    var frameLink = "file://c:\\test\\english\\page1.html"
    
    function changeFrame(link)
    {
        document.getElementById("language").src = link.href;
        frameLink = link.href;
        return false;
    }
    function setFrame( )
    {
        if ( location.search.length > 1 )
        {
            var frameurl = unescape(location.search.substring(1));
            // this line for the English index page:
            frameurl = frameurl.replace( /francais/ig, "english" );
            // this line for the French index page: 
            // frameurl = frameurl.replace( /english/ig, "francais" );
            document.getElementById("language").src = frameurl;
            frameLink = frameurl;
        }
    } 
    </script>
    
    </head>
    
    <body onload="setFrame();">
    
    
    <div id="backgroundWrapper">
    	<div id="container">
    		<div id="masthead">
    			<table style="width: 860px; height: 74px">
    				<tr>
    					<td valign="top" style="width: 69px">
    					<img src="../IMAGES/logo.gif" /></td>
    					<td>
    					<h2>Office of the Law Clerk and Parliamentary Counsel</h2>
    					</td>
    				</tr>
    			</table>
    		</div>
    		<div id="top_nav">
    			<div id="button">
    				<a href="file://///HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/francais/Index-f.htm"
           onclick="this.href += '?' + escape(frameLink); return true;">
    				français</a></div>
    			<!-- navigation -->
    			<ul class="dropdown dropdown-horizontal center">
    				<!-- Home -->
    				<li>
    				<a target="content" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/home/home.html" target="content" onclick="return changeFrame(this);">
    				Home</a>
    				<!-- Publications --></li>
    				<li class="dir">
    				<a target="content" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/publications.html" target="content" onclick="return changeFrame(this);">
    				Publications</a>
    				<ul>
    					<!-- main menu -->
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu1/rules.html" target="content">
    					Prism Bill Editor</a>
    					<!-- menu 1 -->
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu1/manualU/manualU.html" target="content">
    						User Manual</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu1/manualP/manualP.html" target="content">
    						Formbook</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu1/hints/hints.html" target="content">
    						Workaround</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 1 --></li>
    					<li>
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu2/knowledge.html" target="content">
    					Knowledge Transfer Guide</a></li>
    					<!-- menu 2 --></li>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu3/legal.html" target="content">
    					Legislation (OLCPC)</a>
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu3/manualU/manualU.html" target="content">
    						User Manual</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu3/quickSheet/quickSheet.html" target="content">
    						Quick Reference Sheet</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu3/powerPoint/powerPoint.html" target="content">
    						Power Point</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 3 --></li>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu4/prism.html" target="content">
    					Prism</a>
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu4/amendment/amendment.html" target="content">
    						Amendment (Counsel) Module</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu4/project/project.html" target="content">
    						Bill (Counsel) Module</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu4/research/prism.html" target="content">
    						Amendment Search Text Module</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 4 --></li>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu5/reports.html" target="content">
    					Reports and Returns</a>
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu5/word/word.html" target="content">
    						Word Format</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu5/html/html.html" target="content">
    						HTML Format</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu5/web/web.html" target="content">
    						Web Publication</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 5 --></li>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/byLaws.html" target="content">
    					By-Law</a>
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/word/word.html" target="content">
    						Word Format</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/html/html.html" target="content">
    						HTML Format</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/xml/xml.html" target="content">
    						XML Format</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/web/web.html" target="content">
    						Web Publication</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 6 -->
    					<!-- end of publication --></li>
    				</ul>
    				<!-- main menu -->
    				<!-- end of Publications --></li>
    				<!-- Révisions --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/revision/revisions.html" target="content">
    				Revision</a>
    				<ul>
    					<li>
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/revision/s_menu1/reports.html" target="content">
    					Reports and Returns</a></li>
    					<!-- main menu  --></li>
    				</ul>
    				<!-- main menu  -->
    				<!-- end of Révision --></li>
    				<!-- Services juridiques --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/judicial/judicial.html" target="content">
    				Legal Services</a>
    				<ul>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/judicial/s_menu1/legalims.html" target="content">
    					Legalims</a>
    					<!-- main menu  -->
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/judicial/s_menu1/manual/manual.html" target="content">
    						User Manual</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/judicial/s_menu1/quickSheet/quickSheet.html" target="content">
    						Quick Reference Sheet</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/judicial/s_menu1/videos/videos.html" target="content">
    						Videos</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 1  --></li>
    				</ul>
    				<!-- end of Services juridiques --></li>
    				<!-- Services Législatifs --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/legislative.html" target="content">
    				Legislative Services</a>
    				<ul>
    					<!-- main menu -->
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu1/legalims.html" target="content">
    					Legalims</a>
    					<!-- menu 1  -->
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu1/manual/manual.html" target="content">
    						User Manual</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu1/quickSheet/quickSheet.html" target="content">
    						Quick Reference Sheet</a></li>
    						<li>
    						<a href="file://///HOC/AdminPrivate/FS08U/TurgeL/Documents/Site Web/english/legislative/s_menu1/videos/videos.html" target="content">
    						Videos</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 1  --></li>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu2/prism.html" target="content">
    					Prism</a>
    					<!-- menu 2  -->
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu2/amendment/amendment.html" target="content">
    						Amendment (Counsel) Module</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu2/project/project.html" target="content">
    						Bill (Counsel) Module</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu2/research/research.html" target="content">
    						Amendment Search Text Module</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 2 --></li>
    				</ul>
    				<!-- main menu -->
    				<!-- end of Services Législatifs --></li>
    				<!-- Traduction --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/translation/translation.html" target="content">
    				Translation</a>
    				<ul>
    					<!-- main menu -->
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/translation/s_menu1/prism.html" target="content">
    					Prism</a>
    					<!-- menu 1 -->
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/translation/s_menu1/amendment/amendment.html" target="content">
    						Amendment (Counsel) Module</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/translation/s_menu1/research/research.html" target="content">
    						Amendment Search Text Module</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 1 --></li>
    				</ul>
    				<!-- main menu -->
    				<!-- end of Traduction --></li>
    				<!-- Liens --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/links/links.html" target="content">
    				Links</a>
    				<ul>
    					<!-- main menu -->
    					<li>
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/links/s_menu1/useful.html" target="content">
    					Useful Links</a></li>
    					<!-- menu 1 --></li>
    					<li>
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/links/s_menu2/other.html" target="content">
    					Other Links</a></li><!-- menu 2 --> </li>
    				</ul>
    				<!-- main menu -->
    				<!-- end of Liens --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/join/join.html" target="content">
    				Contact Us</a>
    				<ul>
    					<!-- main menu -->
    					<li><a href="mailto:olcpcst@parl.gc.ca">Support Team</a></li>
    					<!-- menu 1 --></li>
    					<li><a href="../english/">???</a></li>
    					<li><a href="../english/">???</a></li><!--menu --> </li>
    					<li><a href="../english/">???</a></li>
    					<!-- menu 1 --></li>
    					<li><a href="../english/">???</a></li>
    					<!-- menu 1 --></li>
    					<li><a href="../english/">???</a></li>
    					<!-- menu 1 --></li>
    				</ul>
    				<!-- main menu -->
    				<!-- end of Contact --></li>
    				<!-- ???? -->
    				<!-- end of navigation --></li>
    			</ul>
    		</div>
    		<div id="page_content">
    			<iframe id="language" style="margin: 0; width: 788px; height: 742px" frameborder="0" src="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/home/home.html">
    			Your browser does not support inline frames or is currently configured 
    			not 
    			to display inline frames.
    			</iframe>
    			<!-- end of page content div --></div>
    		<div id="footer">
    			<!-- end of footer div--></div>
    		<!-- end of container div --></div>
    	<!-- end of backgroundWrapper div --></div>
    
    </body>
    
    </html>

    Cheers
    Attached Thumbnails Attached Thumbnails Bilingual site with iframe issues-english-index-page.jpg   Bilingual site with iframe issues-french-index-page.jpg   Bilingual site with iframe issues-folder-structure.jpg  

  • #8
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    Just for starters, my use of "page1.html" and "page2.html" were just *examples*. To be replaced throughout with your pages.

    So that means that this line:
    Code:
    var frameLink = "file://c:\\test\\english\\page1.html"
    Needs to be *THIS*:
    Code:
    var framelink = "file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/home/home.html";
    I'm looking to see what other changes are needed, if any.

    Back later.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #9
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    The only other thing I see is that *probably* you should get rid of the target="..." from all those links and, of course, make sure that each has the onclick= handler in it.
    Code:
    <a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/home/home.html" 
       onclick="return changeFrame(this);">
       Home</a>
    ...
    <a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/xml/xml.html" 
       onclick="return changeFrame(this);">
       XML Format</a>
    ...
    etc.
    I really did create 6 HTML pages to test this. Both an English and Francais index page and then "page1.html" and "page2.html" each in two subdirectories named .../english/... and .../francais/...

    I could give you all 6 pages if you want, but they really are very very simple.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #10
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    *AHA*!!

    I do see another major problem!!!

    I just *assumed* that the subdirectory names would be the same in both the ...\english\... and ...\francais\... trees. But of course they are *NOT*!!

    "links" vs. "liens", for example.

    So *IN ADDITION* to changing from "english" to "francais" in the file names, we *ALSO* need to change the subdirectory names.
    Code:
    function setFrame( )
    {
        if ( location.search.length > 1 )
        {
            var frameurl = unescape(location.search.substring(1));
    
            // this version is for the French index page: 
            frameurl = frameurl.replace( /english\/home/i, "francais\/accuiel" );
            frameurl = frameurl.replace( /english\/join/i, "francais/joindre" );
            frameurl = frameurl.replace( /english\/judicial/i, "francais/judicial" );
            frameurl = frameurl.replace( /english\/legislative/ig, "francais/legislatif" );
            frameurl = frameurl.replace( /english\/links/ig, "francais/liens" );
            frameurl = frameurl.replace( /english\/publications/ig, "francais/publications" );
            frameurl = frameurl.replace( /english\/revision/ig, "francais/revision" );
            frameurl = frameurl.replace( /english\/translation/ig, "francais/traduction" );
    
            document.getElementById("language").src = frameurl;
            frameLink = frameurl;
        }
    }
    Something along those lines???
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #11
    New Coder
    Join Date
    Aug 2010
    Posts
    39
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Yes, I realize that, I had forgotten to update that link in the script section. It's done now.

    Now, when I hit the language button to switch to French, it feeds the French index file along with its default iframe file. This can be done without javascript easily.

    I need javascript to feed ALSO the French version of the iframe file that was there JUST BEFORE I HIT THE 'FRANCAIS' BUTTON. That file has a different path and name and is listed only in the french index.

    I may be wrong, but I guess it can be accessed either of 2 ways:

    through the 'francais' folder path which has the same steps as the 'english' one

    or

    through the 'french' index file within which it is listed as a clickable link


    That's the remaining challenge at this point.

  • #12
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    I need javascript to feed ALSO the French version of the iframe file that was there JUST BEFORE I HIT THE 'FRANCAIS' BUTTON. That file has a different path and name and is listed only in the french index.
    That's what I *THOUGHT* my code is doing. And that's exactly what it does in my working sample pages.

    That's the whole point of this code:
    Code:
    <a href="file://///HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/francais/Index-f.htm"
            onclick="this.href += '?' + escape(frameLink); return true;">
        français</a></div>
    When you click on one of the iframe links, the call to changeFrame( ) gets the HREF value of the <a> tag you clicked on and stores it in the frameLink variable. It also, of course, changes the <iframe>'s contents, by changing the ".src" property. It does the return false to ensure that the normal action of the <a> link does not happen.

    So then, when you change the index page (e.g., click on the "Francais" link), the code *alters* the index link to include the URL of the iframe--which we carefully stored in the frameLink variable. And then, when you arrive on the French index page, *IT* reads that frameLink value from the URL and uses it to appropriately change the iframe contents.

    As I say, this *DOES* work in my sample pages. If it doesn't work in your actual pages, it must be some little thing we are missing.

    Just for starters, do this:
    (1) bring up the English main page.
    (2) select one of the iframe links that you *HAVE* converted to use the call to changeFrame() [do NOT use one of the un-converted ones].
    (3) click on the "francais" link to change the index page.
    (4) LOOK at the URL of the page! It should look *something* like:
    Code:
    file://///HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/francais/Index-f.htm?file%3A//HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu1/rules.html
    Maybe not exactly that, but close. The important part being that the URL of the chosen iframe contents should follow the question mark.

    IS THAT HAPPENING???
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #13
    New Coder
    Join Date
    Aug 2010
    Posts
    39
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Old Pedant,

    You're awesome... I have a lot respect both for the time that you have dedicated to this thread and your mastery of JavaScript.

    This thing is starting to work and I'm really excited!...

    Here's the scoop. The language switch occurs at this time, especially with the Publications and Revision link. What remains is the following:

    - There seems to be a need to refresh everytime for the switch to take place properly. Otherwise you are sent back to the default index iframe file (home/accueil) or you get an 'Internet Explorer cannot display the webpage'.

    - If you client on the 'English' button and then back to French with the 'French' button, it will work the first time, but the secon time - when you hit the 'french' button, you are are sent to the French index default iframe file... and then if you hit the button again, you get the 'Internet Explorer cannot display the webpage'.

    - Some links do not seems to work at all yet, such as the links/liens link

    I carefully reviewed the code for typos or inconsistent patterns but everything seems ok!? My guess is part of the problem must be related to a vaiable that need to be refreshed contantly after clicking a link and is not.

    GO GO GO, we're almost there! Another punch and we're knocking out!

    You're the best

    Here's my updated code for the English index page:

    Code:
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
    
    <head>
    <title>Reference Tools</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--[if lt IE 7]>
    <script type="text/javascript" src="../js/jquery/jquery.js"></script>
    <script type="text/javascript" src="../js/jquery/jquery.dropdown.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../CSS/main.css" />
    <link rel="stylesheet" type="text/css" href="../css/dropdown/dropDownLayOut.css" />
    <link rel="stylesheet" type="text/css" href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/CSS/dropdown/dropDownStyles.css" />
    
    <script type="text/javascript">
    var frameLink = "file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/home/home.html"
    
    function changeFrame(link)
    {
        document.getElementById("language").src = link.href;
        frameLink = link.href;
        return false;
    }
    function setFrame( )
    {
        if ( location.search.length > 1 )
        {
            var frameurl = unescape(location.search.substring(1));
    
            // this version is for the English index page: 
            frameurl = frameurl.replace( /francais\/accueil/i, "english/home" );
            frameurl = frameurl.replace( /francais\/joindre/i, "english/join" );
            frameurl = frameurl.replace( /francais\/judicial/i, "english/judicial" );
            frameurl = frameurl.replace( /francais\/legislatif/ig, "english/legislative" );
            frameurl = frameurl.replace( /francais\/liens/ig, "english/links" );
            frameurl = frameurl.replace( /francais\/publications/ig, "english/publications" );
            frameurl = frameurl.replace( /francais\/revision/ig, "english/revision" );
            frameurl = frameurl.replace( /francais\/traduction/ig, "english/translation" );
    
            document.getElementById("language").src = frameurl;
            frameLink = frameurl;
        }
    }
    </script>
    
    </head>
    
    <body onload="setFrame();">
    
    
    <div id="backgroundWrapper">
    	<div id="container">
    		<div id="masthead">
    			<table style="width: 860px; height: 74px">
    				<tr>
    					<td valign="top" style="width: 69px">
    					<img src="../IMAGES/logo.gif" /></td>
    					<td>
    					<h2>Office of the Law Clerk and Parliamentary Counsel</h2>
    					</td>
    				</tr>
    			</table>
    		</div>
    		<div id="top_nav">
    			<div id="button">
    				<a href="file://///HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/francais/Index-f.htm"
           onclick="this.href += '?' + escape(frameLink); return true;">
    				français</a></div>
    			<!-- navigation -->
    			<ul class="dropdown dropdown-horizontal center">
    				<!-- Home -->
    				<li>
    				<a  href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/home/home.html" onclick="return changeFrame(this);">
    				Home</a>
    				<!-- Publications --></li>
    				<li class="dir">
    				<a  href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/publications.html" onclick="return changeFrame(this);">
    				Publications</a>
    				<ul>
    					<!-- main menu -->
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu1/rules.html" onclick="return changeFrame(this);">
    					Prism Bill Editor</a>
    					<!-- menu 1 -->
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu1/manualU/manualU.html"  onclick="return changeFrame(this);">
    						User Manual</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu1/manualP/manualP.html"  onclick="return changeFrame(this);">
    						Formbook</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu1/hints/hints.html"  onclick="return changeFrame(this);">
    						Workaround</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 1 --></li>
    					<li>
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu2/knowledge.html" onclick="return changeFrame(this);">
    					Knowledge Transfer Guide</a></li>
    					<!-- menu 2 --></li>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu3/legal.html" onclick="return changeFrame(this);">
    					Legislation (OLCPC)</a>
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu3/manualU/manualU.html" onclick="return changeFrame(this);">
    						User Manual</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu3/quickSheet/quickSheet.html" onclick="return changeFrame(this);">
    						Quick Reference Sheet</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu3/powerPoint/powerPoint.html" onclick="return changeFrame(this);">
    						Power Point</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 3 --></li>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu4/prism.html" onclick="return changeFrame(this);">
    					Prism</a>
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu4/amendment/amendment.html" onclick="return changeFrame(this);">
    						Amendment (Counsel) Module</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu4/project/project.html" onclick="return changeFrame(this);">
    						Bill (Counsel) Module</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu4/research/prism.html" onclick="return changeFrame(this);">
    						Amendment Search Text Module</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 4 --></li>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu5/reports.html" onclick="return changeFrame(this);">
    					Reports and Returns</a>
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu5/word/word.html" onclick="return changeFrame(this);">
    						Word Format</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu5/html/html.html" onclick="return changeFrame(this);">
    						HTML Format</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu5/web/web.html" onclick="return changeFrame(this);">
    						Web Publication</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 5 --></li>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/byLaws.html" onclick="return changeFrame(this);">
    					By-Law</a>
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/word/word.html" onclick="return changeFrame(this);">
    						Word Format</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/html/html.html" onclick="return changeFrame(this);">
    						HTML Format</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/xml/xml.html" onclick="return changeFrame(this);">
    						XML Format</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/publications/s_menu6/web/web.html" onclick="return changeFrame(this);">
    						Web Publication</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 6 -->
    					<!-- end of publication --></li>
    				</ul>
    				<!-- main menu -->
    				<!-- end of Publications --></li>
    				<!-- Révisions --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/revision/revisions.html" onclick="return changeFrame(this);">
    				Revision</a>
    				<ul>
    					<li>
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/revision/s_menu1/reports.html" onclick="return changeFrame(this);">
    					Reports and Returns</a></li>
    					<!-- main menu  --></li>
    				</ul>
    				<!-- main menu  -->
    				<!-- end of Révision --></li>
    				<!-- Services juridiques --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/judicial/judicial.html" onclick="return changeFrame(this);">
    				Legal Services</a>
    				<ul>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/judicial/s_menu1/legalims.html" onclick="return changeFrame(this);">
    					Legalims</a>
    					<!-- main menu  -->
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/judicial/s_menu1/manual/manual.html" onclick="return changeFrame(this);">
    						User Manual</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/judicial/s_menu1/quickSheet/quickSheet.html" onclick="return changeFrame(this);">
    						Quick Reference Sheet</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/judicial/s_menu1/videos/videos.html" onclick="return changeFrame(this);">
    						Videos</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 1  --></li>
    				</ul>
    				<!-- end of Services juridiques --></li>
    				<!-- Services Législatifs --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/legislative.html" onclick="return changeFrame(this);">
    				Legislative Services</a>
    				<ul>
    					<!-- main menu -->
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu1/legalims.html" onclick="return changeFrame(this);">
    					Legalims</a>
    					<!-- menu 1  -->
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu1/manual/manual.html" onclick="return changeFrame(this);">
    						User Manual</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu1/quickSheet/quickSheet.html" onclick="return changeFrame(this);">
    						Quick Reference Sheet</a></li>
    						<li>
    						<a href="file://///HOC/AdminPrivate/FS08U/TurgeL/Documents/Site Web/english/legislative/s_menu1/videos/videos.html" onclick="return changeFrame(this);">
    						Videos</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 1  --></li>
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu2/prism.html" onclick="return changeFrame(this);">
    					Prism</a>
    					<!-- menu 2  -->
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu2/amendment/amendment.html" onclick="return changeFrame(this);">
    						Amendment (Counsel) Module</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu2/project/project.html" onclick="return changeFrame(this);">
    						Bill (Counsel) Module</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/legislative/s_menu2/research/research.html" onclick="return changeFrame(this);">
    						Amendment Search Text Module</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 2 --></li>
    				</ul>
    				<!-- main menu -->
    				<!-- end of Services Législatifs --></li>
    				<!-- Traduction --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/translation/translation.html" onclick="return changeFrame(this);">
    				Translation</a>
    				<ul>
    					<!-- main menu -->
    					<li class="dir">
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/translation/s_menu1/prism.html" onclick="return changeFrame(this);">
    					Prism</a>
    					<!-- menu 1 -->
    					<ul>
    						<!-- sous-menu -->
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/translation/s_menu1/amendment/amendment.html" onclick="return changeFrame(this);">
    						Amendment (Counsel) Module</a></li>
    						<li>
    						<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/translation/s_menu1/research/research.html" onclick="return changeFrame(this);">
    						Amendment Search Text Module</a></li>
    					</ul>
    					<!-- sous-menu --></li>
    					<!-- menu 1 --></li>
    				</ul>
    				<!-- main menu -->
    				<!-- end of Traduction --></li>
    				<!-- Liens --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/links/links.html" onclick="return changeFrame(this);">
    				Links</a>
    				<ul>
    					<!-- main menu -->
    					<li>
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/links/s_menu1/useful.html" onclick="return changeFrame(this);">
    					Useful Links</a></li>
    					<!-- menu 1 --></li>
    					<li>
    					<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/links/s_menu2/other.html" onclick="return changeFrame(this);">
    					Other Links</a></li><!-- menu 2 --> </li>
    				</ul>
    				<!-- main menu -->
    				<!-- end of Liens --></li>
    				<li class="dir">
    				<a href="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/join/join.html" onclick="return changeFrame(this);">
    				Contact Us</a>
    				<ul>
    					<!-- main menu -->
    					<li><a href="mailto:olcpcst@parl.gc.ca">Support Team</a></li>
    					<!-- menu 1 --></li>
    					<li><a href="../english/">???</a></li>
    					<li><a href="../english/">???</a></li><!--menu --> </li>
    					<li><a href="../english/">???</a></li>
    					<!-- menu 1 --></li>
    					<li><a href="../english/">???</a></li>
    					<!-- menu 1 --></li>
    					<li><a href="../english/">???</a></li>
    					<!-- menu 1 --></li>
    				</ul>
    				<!-- main menu -->
    				<!-- end of Contact --></li>
    				<!-- ???? -->
    				<!-- end of navigation --></li>
    			</ul>
    		</div>
    		<div id="page_content">
    			<iframe id="language" style="margin: 0; width: 788px; height: 742px" frameborder="0" src="file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/home/home.html">
    			Your browser does not support inline frames or is currently configured 
    			not 
    			to display inline frames.
    			</iframe>
    			<!-- end of page content div --></div>
    		<div id="footer">
    			<!-- end of footer div--></div>
    		<!-- end of container div --></div>
    	<!-- end of backgroundWrapper div --></div>
    
    </body>
    
    </html>

  • #14
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    The only thing I can suggest is that you start doing some DEBUGGING.

    You could use Firebug with Firefox, setting some breakpoints and inspecting variables.

    But it *MIGHT* be sufficient to add in some debug alert() calls so you can watch what is (or is not!) happening.

    So start with something like this:
    Code:
    <script type="text/javascript">
    var frameLink = "file://HOC/AdminPrivate/FS08U/TurgeL/Documents/Site%20Web/english/home/home.html"
    
    function changeFrame(link)
    {
        document.getElementById("language").src = link.href;
        frameLink = link.href;
        alert("DEBUG changeFrame:\nframeLink now: " + frameLine);
        return false;
    }
    function setFrame( )
    {
        if ( location.search.length > 1 )
        {
            var frameurl = unescape(location.search.substring(1));
            var original = frameurl;
    
            // this version is for the English index page: 
            frameurl = frameurl.replace( /francais\/accueil/i, "english/home" );
            frameurl = frameurl.replace( /francais\/joindre/i, "english/join" );
            frameurl = frameurl.replace( /francais\/judicial/i, "english/judicial" );
            frameurl = frameurl.replace( /francais\/legislatif/ig, "english/legislative" );
            frameurl = frameurl.replace( /francais\/liens/ig, "english/links" );
            frameurl = frameurl.replace( /francais\/publications/ig, "english/publications" );
            frameurl = frameurl.replace( /francais\/revision/ig, "english/revision" );
            frameurl = frameurl.replace( /francais\/traduction/ig, "english/translation" );
    
            document.getElementById("language").src = frameurl;
            frameLink = frameurl;
        
            alert( "DEBUG setFrame:\noriginal url: " + original + "\nframeLink now: " + frameLink );
    
        }
    }
    </script>
    Add in the red debug code and then make note of what it shows you as you navigate and/or change index pages.

    If you ever do *NOT* get an alert() when you navigate or when you change index pages, that's an indication that something is missing. If the debug info seems inconsistent with the action you just took, note that as well.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #15
    New Coder
    Join Date
    Aug 2010
    Posts
    39
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Old Pedant,

    It's all functionnal! Again, you have been awesome. Hopefully, I can get good enough at that stuff so I can pass it forward someday.


    I notices a pattern which helped me to sove the problem. I noticed that for the links connected to folders which had identical names in the French AND English folder, it worked fine. It wasn't for the others.

    So, I renamed all my french folders and file names to be exactly the same as the English ones and bang... it worked.

    It's been a long journey trying to get this work with my humble knowledge of JavasCript. Thank you my friend and I tip my hat to you.


    Over!...


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •