473,782 Members | 2,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why doesnt changing src with js work for iframes in safari?

hey this code wont work for my iframe in safari, i cant change the page
by changing the src with js:

<script language="javas cript">
function loadcontent(pag e) {
document.getEle mentById('ifram eid').src = page;
}
</script>
<iframe align="right" width="100%" src="links.php" id="content"
name="content" frameborder="0" style=" height:400px; border:none;
margin:0px; padding:0px;"></iframe>

Sep 20 '06 #1
4 6460

libsfan01 wrote:
hey this code wont work for my iframe in safari, i cant change the page
by changing the src with js:
It works fine in Safari 2.0.4 (Mac OS X 10.4). Maybe you are testing
on 1.x?

<script language="javas cript">
The language attribute is deprecated, type is required:

<script type="text/javascript">

function loadcontent(pag e) {
document.getEle mentById('ifram eid').src = page;
}
</script>

--
Rob

Sep 20 '06 #2
libsfan01 wrote:
hey this code wont work for my iframe in safari, i cant change the page
by changing the src with js:

<script language="javas cript">
function loadcontent(pag e) {
document.getEle mentById('ifram eid').src = page;
}
</script>
There is no reason to expect changing the - src - property of an IFRAME
to result in the navigation of the contained page as the HTML DOM
specification defines the property as 'the URL of the original contents
of the IFRAME', and changing the original contents has no clear
meaning.

If you want to navigate an IFRAME reliably assign the URL to the -
location - property of the window/frame object it contains.

Richard.

Sep 20 '06 #3
If you want to navigate an IFRAME reliably assign the URL to the -
location - property of the window/frame object it contains.

Richard.
Thanks for your help Richard, i had feleing it was something like that.
The changing SRC effort was really my first stab at doing it.

What would the syntax look like for the proper method?

regards

Marc

Sep 20 '06 #4
libsfan01 wrote:
>If you want to navigate an IFRAME reliably assign the URL to the -
location - property of the window/frame object it contains.

Thanks for your help Richard, i had feleing it was something like that.
The changing SRC effort was really my first stab at doing it.

What would the syntax look like for the proper method?
<script type="text/javascript">
function loadcontent(url , frameName) {
frames[frameName].location = url;
}
</script>

Where the IFRAME should have a NAME attribute (possibly along with an
ID attribute, but they _must_ be identical) and it is the value of the
NAME attribute that is used to look up the window/frame object in the
current window's - frames - collection.

Richard.

Sep 20 '06 #5

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

Similar topics

0
2100
by: Dan Popa | last post by:
Check out the following 2 links: http://www.batisdev.com/admin/test_1images.asp http://www.batisdev.com/admin/test_2images.asp First page contain 4 IFRAMES and 1 IMG tags. Second page contain 4 IFRAMES and 2 IMGs tags. The problem is that the second IFRAME from the second page generates fires a new session.
3
1277
by: Ranbir Kaur | last post by:
Hi all, http://www.gurmatps.org works fine in MSIE6, Opera7, NS7 (for windows) Could someone do me the favor and check what may be wrong that it doesn't display right in MAC browsers? Thanks Ranbir
2
5260
by: rpesq | last post by:
Hi, I Need help changing the content of a DIV. I sincerely researched the issue and have not found a solution except to scrap the idea and stick with the iframe code that I had been using. My purpose here is to avoid iframes. I know how to change the DIV content to other basic html statements, such as basic IMG's or Lists, but I want to put a Javascript into the DIV, and have not found a way to do it.
2
1720
by: Bogosian | last post by:
Hi to all.I have to solve the following problem.I have to make a website which will be a web cache machine with the look of a real cache machine - screen and buttons below it.So i plan the background to be an image and when users cklick the buttons only some of the data on the screen will change.I want to make this background image static(including the buttons if possible because otherwise it'll be very ugly if the buttons leave blank...
12
2072
by: effendi | last post by:
I wrote the following function and tested it in MSIE, Firefox and Mac Safari, Works in all but the Safari. What can I do to rectify this? function processBackground(){ for (n=1;n<11;n++) { cellrow="r"+n for (i=1;i<17;i++){ cell=cellrow+"w"+i cellName=cell+"_ID"
2
2830
by: effendi | last post by:
Hi I tested the following function in Safari and it doesnt work. This is tested fine in IE. function processOutcome(){ mainDatabase=document.forms.AssessDatabase.value var oCheckboxs=document.forms.TeamID if (oCheckboxs=="undefined" )
5
14797
by: luckydenis2007 | last post by:
I am trying to access image information that is displayed using iframe. iframe code looks like this: <iframe id="testImage" src="/images/someimg.gif" scrolling="yes" frameborder="0" style="border: 0; width: 280px; height: 455px;"></ iframe> I need to figure out height of the image. In Firefox and IE it is not a problem.
4
1554
by: libsfan01 | last post by:
in firefox the following alert does not get created from my function: ch = container1.childNodes(0).id; alert(ch) can anyone tell why this might not work in firefox but does in safari? thanks marc
8
7996
by: kaaposc | last post by:
Hello! This is not question, I was just wondering, why people continue using frames and iframes when we have handy AJAX approach to fill needed divs with content. Is it because of some user's paranoia about javascript? But if they make pages without javascript, they would not need to bother, how to access other frame's content, would they? :) kaaposc
0
9641
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.