[jQuery] Re: how to change the iframe src
Don't forget the space between iframe and id: $('#connectframe'+' iframe').attr("src"," Why do you have a concatination there anyway ??? $('#connectframe iframe').attr("src"," Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Feb 7, 2009 at 4:08 AM, cindy wrote: > > I tried to use Richardo' method, it is still not working. > SourceCOde: > www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > http://www.w3.org/1999/xhtml";> > > >RAP Console > > > > > var refreshTime=3; > var summaryTab=1; > var connectTab=2; > var diagTab=3; > var isSummaryInit= true; > var isConnectInit=false; > var isDiagInit=false; > var mode="protype"; > var currentTab=summaryTab; > > > function clickTab( tabName) > { >if(tabName==currentTab) return; >if(tabName==summaryTab) >{ > > $('#summaryframe'+'iframe').attr("src","http://www.google.com";); >} >else if(tabName==connectTab) >{ >$('#connectframe'+'iframe').attr("src","http://www.yahoo.com";); >} >else if(tabName==diagTab) >{ >$('#diagframe'+'iframe').attr("src","http://www.yelp.com";); >} >currentTab=tabName; > }; > > $(document).ready(init); > function init() > { >$('#Summary').bind('click',function(){clickTab(summaryTab)}); >$('#Connectivity').bind('click',function(){clickTab(connectTab)}); >$('#Diag').bind('click',function(){clickTab(diagTab)}); > }; > > > > > > > > > > >Summary >Connectivity >Diagnostics > > > >Connection Status: > Last updated: 10:31:14 AM >Refresh > Generate & save support file > > > > frameborder="1"> > > > frameborder="1"> > > > frameborder="1"> > > > > > > On Feb 6, 2:48 pm, Ricardo Tomasi wrote: >> $('connectframe'+'iframe') >> >> should be >> >> $('#connectframe'+' iframe') (notice the whitespace) and so on.. >> >> On Feb 6, 7:34 pm, cindy wrote: >> >> > Hi, >> >> > what I want to do is to change iframe src, when click the tab. The >> > click function is called, but the iframe src is not changed at all. Do >> > you know what is wrong? >> >> > Cindy >> >> > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> >> > http://www.w3.org/1999/xhtml";> >> > >> > >> > RAP Console >> > >> > >> > >> > >> > var refreshTime=3; >> > var summaryTab=1; >> > var connectTab=2; >> > var diagTab=3; >> > var isSummaryInit= true; >> > var isConnectInit=false; >> > var isDiagInit=false; >> > var mode="protype"; >> > var currentTab=summaryTab; >> >> > function clickTab( tabName) >> > { >> > if(tabName==currentTab) return; >> > if(tabName==summaryTab) >> > { >> > >> > $('summaryframe'+'iframe').attr("src","http://www.google.com";); >> > setFocus('summaryframe'); >> > } >> > else if(tabName==connectTab) >> > { >> > >> > $('connectframe'+'iframe').attr("src","http://www.yahoo.com";); >> > setFocus('connectframe'); >> > } >> > else if(tabName==diagTab) >> > { >> > $('diagframe'+'iframe').attr("src","http://www.yelp.com";); >> > setFocus('diagframe'); >> > } >> > currentTab=tabName; >> >> > }; >> >> > $(document).ready(init); >> > function init() >> > { >> > $('#Summary').bind('click',function(){clickTab(summaryTab)}); >> > $('#Connectivity').bind('click',function(){clickTab(connectTab)}); >> > $('#Diag').bind('click',function(){clickTab(diagTab)}); >> >> > }; >> >> > >> > >> > >> > >> > >> > >> > >> > >> > Summary >> > Connectivity >> > Diagnostics >> > >> > >> > >> > Connection Status: >> > Last updated: 10:31:14 AM >> > Refresh >> > Generate & save support file >> > >> > >> > >> > > > frameborder="1"> >> > >> > >> > > > frameborder="1"> >> > >> > >> >
[jQuery] Re: how to change the iframe src
I tried to use Richardo' method, it is still not working. SourceCOde: http://www.w3.org/1999/xhtml";> RAP Console var refreshTime=3; var summaryTab=1; var connectTab=2; var diagTab=3; var isSummaryInit= true; var isConnectInit=false; var isDiagInit=false; var mode="protype"; var currentTab=summaryTab; function clickTab( tabName) { if(tabName==currentTab) return; if(tabName==summaryTab) { $('#summaryframe'+'iframe').attr("src","http://www.google.com";); } else if(tabName==connectTab) { $('#connectframe'+'iframe').attr("src","http://www.yahoo.com";); } else if(tabName==diagTab) { $('#diagframe'+'iframe').attr("src","http://www.yelp.com";); } currentTab=tabName; }; $(document).ready(init); function init() { $('#Summary').bind('click',function(){clickTab(summaryTab)}); $('#Connectivity').bind('click',function(){clickTab(connectTab)}); $('#Diag').bind('click',function(){clickTab(diagTab)}); }; Summary Connectivity Diagnostics Connection Status: Last updated: 10:31:14 AM Refresh Generate & save support file On Feb 6, 2:48 pm, Ricardo Tomasi wrote: > $('connectframe'+'iframe') > > should be > > $('#connectframe'+' iframe') (notice the whitespace) and so on.. > > On Feb 6, 7:34 pm, cindy wrote: > > > Hi, > > > what I want to do is to change iframe src, when click the tab. The > > click function is called, but the iframe src is not changed at all. Do > > you know what is wrong? > > > Cindy > > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > > http://www.w3.org/1999/xhtml";> > > > > > > RAP Console > > > > > > > > > > var refreshTime=3; > > var summaryTab=1; > > var connectTab=2; > > var diagTab=3; > > var isSummaryInit= true; > > var isConnectInit=false; > > var isDiagInit=false; > > var mode="protype"; > > var currentTab=summaryTab; > > > function clickTab( tabName) > > { > > if(tabName==currentTab) return; > > if(tabName==summaryTab) > > { > > > > $('summaryframe'+'iframe').attr("src","http://www.google.com";); > > setFocus('summaryframe'); > > } > > else if(tabName==connectTab) > > { > > > > $('connectframe'+'iframe').attr("src","http://www.yahoo.com";); > > setFocus('connectframe'); > > } > > else if(tabName==diagTab) > > { > > $('diagframe'+'iframe').attr("src","http://www.yelp.com";); > > setFocus('diagframe'); > > } > > currentTab=tabName; > > > }; > > > $(document).ready(init); > > function init() > > { > > $('#Summary').bind('click',function(){clickTab(summaryTab)}); > > $('#Connectivity').bind('click',function(){clickTab(connectTab)}); > > $('#Diag').bind('click',function(){clickTab(diagTab)}); > > > }; > > > > > > > > > > > > > > > > > > > Summary > > Connectivity > > Diagnostics > > > > > > > > Connection Status: > > Last updated: 10:31:14 AM > > Refresh > > Generate & save support file > > > > > > > > > frameborder="1"> > > > > > > > frameborder="1"> > > > > > > > frameborder="1"> > > > > > > > >
[jQuery] Re: how to change the iframe src
the src int he iframe needs to access parent's java script. I have to set src. On Feb 6, 2:02 pm, "Andy Matthews" wrote: > It might be easier to just use the location method. > > .location.href = 'newlink.html'; > > -Original Message- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > Behalf Of cindy > Sent: Friday, February 06, 2009 3:35 PM > To: jQuery (English) > Subject: [jQuery] how to change the iframe src > > Hi, > > what I want to do is to change iframe src, when click the tab. The click > function is called, but the iframe src is not changed at all. Do you know > what is wrong? > > Cindy > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > > RAP Console > >var refreshTime=3; var > summaryTab=1; var connectTab=2; var diagTab=3; var isSummaryInit= true; var > isConnectInit=false; var isDiagInit=false; var mode="protype"; var > currentTab=summaryTab; > > function clickTab( tabName) > { > if(tabName==currentTab) return; > if(tabName==summaryTab) > { > > $('summaryframe'+'iframe').attr("src","http://www.google.com";); > setFocus('summaryframe'); > } > else if(tabName==connectTab) > { > > $('connectframe'+'iframe').attr("src","http://www.yahoo.com";); > setFocus('connectframe'); > } > else if(tabName==diagTab) > { > $('diagframe'+'iframe').attr("src","http://www.yelp.com";); > setFocus('diagframe'); > } > currentTab=tabName; > }; > > $(document).ready(init); > function init() > { > $('#Summary').bind('click',function(){clickTab(summaryTab)}); > $('#Connectivity').bind('click',function(){clickTab(connectTab)}); > $('#Diag').bind('click',function(){clickTab(diagTab)}); > }; > > > > > > > > > > Summary > Connectivity > Diagnostics > > > > Connection Status: > Last updated: 10:31:14 AM > Refresh > Generate & save support file > > > > frameborder="1"> > > > frameborder="1"> > > > frameborder="1"> > > > >
[jQuery] Re: how to change the iframe src
$('connectframe'+'iframe') should be $('#connectframe'+' iframe') (notice the whitespace) and so on.. On Feb 6, 7:34 pm, cindy wrote: > Hi, > > what I want to do is to change iframe src, when click the tab. The > click function is called, but the iframe src is not changed at all. Do > you know what is wrong? > > Cindy > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > > RAP Console > > > > > var refreshTime=3; > var summaryTab=1; > var connectTab=2; > var diagTab=3; > var isSummaryInit= true; > var isConnectInit=false; > var isDiagInit=false; > var mode="protype"; > var currentTab=summaryTab; > > function clickTab( tabName) > { > if(tabName==currentTab) return; > if(tabName==summaryTab) > { > > $('summaryframe'+'iframe').attr("src","http://www.google.com";); > setFocus('summaryframe'); > } > else if(tabName==connectTab) > { > $('connectframe'+'iframe').attr("src","http://www.yahoo.com";); > setFocus('connectframe'); > } > else if(tabName==diagTab) > { > $('diagframe'+'iframe').attr("src","http://www.yelp.com";); > setFocus('diagframe'); > } > currentTab=tabName; > > }; > > $(document).ready(init); > function init() > { > $('#Summary').bind('click',function(){clickTab(summaryTab)}); > $('#Connectivity').bind('click',function(){clickTab(connectTab)}); > $('#Diag').bind('click',function(){clickTab(diagTab)}); > > }; > > > > > > > > > > Summary > Connectivity > Diagnostics > > > > Connection Status: > Last updated: 10:31:14 AM > Refresh > Generate & save support file > > > > frameborder="1"> > > > frameborder="1"> > > > frameborder="1"> > > > >
[jQuery] Re: how to change the iframe src
It might be easier to just use the location method. .location.href = 'newlink.html'; -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of cindy Sent: Friday, February 06, 2009 3:35 PM To: jQuery (English) Subject: [jQuery] how to change the iframe src Hi, what I want to do is to change iframe src, when click the tab. The click function is called, but the iframe src is not changed at all. Do you know what is wrong? Cindy http://www.w3.org/1999/xhtml";> RAP Console var refreshTime=3; var summaryTab=1; var connectTab=2; var diagTab=3; var isSummaryInit= true; var isConnectInit=false; var isDiagInit=false; var mode="protype"; var currentTab=summaryTab; function clickTab( tabName) { if(tabName==currentTab) return; if(tabName==summaryTab) { $('summaryframe'+'iframe').attr("src","http://www.google.com";); setFocus('summaryframe'); } else if(tabName==connectTab) { $('connectframe'+'iframe').attr("src","http://www.yahoo.com";); setFocus('connectframe'); } else if(tabName==diagTab) { $('diagframe'+'iframe').attr("src","http://www.yelp.com";); setFocus('diagframe'); } currentTab=tabName; }; $(document).ready(init); function init() { $('#Summary').bind('click',function(){clickTab(summaryTab)}); $('#Connectivity').bind('click',function(){clickTab(connectTab)}); $('#Diag').bind('click',function(){clickTab(diagTab)}); }; Summary Connectivity Diagnostics Connection Status: Last updated: 10:31:14 AM Refresh Generate & save support file