JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 1st, 2008, 03:11 PM
timmyo timmyo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 5 timmyo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 15 sec
Reputation Power: 0
Variable not defined.

I'm a beginner with javascript and I'm running into this problem:

I'm getting an undefined. Working with an iframe. I have everything wrapped in a function "init()" in my external and I'm calling init between </body> and </html>.

The onclick triggers as it should. But then I'm getting "iframe is undefined" on this line:
Code:
iframe.location.href = "t1.html";
Here's the whole onclick function:
Code:
autousa.onclick = function() {
        var iframe;
        if (document.frames) {
            iframe = document.frames["testimonialsIframe"];
        } else {
            iframe = window.frames["testimonialsIframe"];
        }
        iframe.location.href = "t1.html";
            
    }


Obviously window.frames["testimonialsIframe"]; is not defined (that is the one it is using for firefox). I dunno why it's not working.

Helppp

By the way... Here's the HTML:
Code:
<iframe src="tAutoUsa.html" id="testimonialsIframe" name"testimonialsIframe" class="testimonials">
        </iframe>

Reply With Quote
  #2  
Old October 1st, 2008, 04:33 PM
vbrtrmn's Avatar
vbrtrmn vbrtrmn is offline
4:04 Time Not Found
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2004
Location: Northern Virginia
Posts: 2,273 vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level)vbrtrmn User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 22 h 10 m
Reputation Power: 337
Send a message via ICQ to vbrtrmn Send a message via AIM to vbrtrmn Send a message via MSN to vbrtrmn Send a message via Yahoo to vbrtrmn
How about:
Code:
document.getElementById('testimonialsIframe').src = 't1.html';
__________________
I am so smart, I am so smart, S.M.R.T ... I mean S.M.A.R.T.

Stop Using Pop-Ups

Reply With Quote
  #3  
Old October 2nd, 2008, 12:20 PM
timmyo timmyo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 5 timmyo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 15 sec
Reputation Power: 0
Well actually the problem was that there was no = in name"dlsjfsdl".

That's embarrassing.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Variable not defined.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap