473,651 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

createElement(" object") and Problems in IE / FF

hi there!

i've the following piece of html:

<div id="tbl"></div>

and i'm trying to create an object with the following javascript code:

var objDiv = document.getEle mentById("tbl") ;
var obj = document.create Element("object ");

obj.data = "text.php";
obj.type = "text/html";
obj.id = "obj_result s";
obj.width ="500px";
obj.height="300 px";
objDiv.appendCh ild(obj);

this all seems to work fine in firefox, but wont in ie. firefox also
doesn't care about if I create an embed or an param element, the object
is loaded as wanted. is there any solution for my problem?

cheers, christian

Sep 14 '06 #1
7 8003
VK

ch*******@mazed lx.net wrote:
i've the following piece of html:

<div id="tbl"></div>

and i'm trying to create an object with the following javascript code:

var objDiv = document.getEle mentById("tbl") ;
var obj = document.create Element("object ");

obj.data = "text.php";
obj.type = "text/html";
obj.id = "obj_result s";
obj.width ="500px";
obj.height="300 px";
objDiv.appendCh ild(obj);

this all seems to work fine in firefox
Does it still?? I have to check it and report to Bugzilla if indeed.
but wont in ie. firefox also
doesn't care about if I create an embed or an param element, the object
is loaded as wanted. is there any solution for my problem?
Cross-domain security overpass using embedded objects was a big issue a
couple of years ago. I can't believe it is still in effect by now: a
full check is needed.
Thanks for a hint!

Sep 14 '06 #2
VK wrote:
ch*******@mazed lx.net wrote:
<snip>
> var obj = document.create Element("object ");

obj.data = "text.php";
<snip>
> objDiv.appendCh ild(obj);

this all seems to work fine in firefox

Does it still?? I have to check it and report to Bugzilla if indeed.
You have never made it clear what definition you use for "bug", but
clearly it is very different from anything used in programming.
but wont in ie. firefox also
doesn't care about if I create an embed or an param element, the object
is loaded as wanted. is there any solution for my problem?

Cross-domain security overpass
"Security overpass"?
using embedded objects was a big issue a
couple of years ago. I can't believe it is still in effect by now:
What is cross-domain about loading the relative URL "text.php"?
a full check is needed.
LOL.
Thanks for a hint!
?

Richard.

Sep 14 '06 #3
VK
Richard Cornford wrote:
You have never made it clear what definition you use for "bug", but
clearly it is very different from anything used in programming.
security overpass"?
LOL.
First of all, I di use the word "bug". That is an "unexpected feature
use" if musted to be classified. Secondly, you, guys, like from a time
warp. A 1/3rd (at least) of the world suffered of a virtual browser
initialized over <objecttag, but clj has no information about it.

Sorry to be nasty - but speechless...

Sep 14 '06 #4
thx guys for the relpies, but none of those help me to solve my problem
to get the object to work in IE...

Sep 14 '06 #5


ch*******@mazed lx.net wrote:

i've the following piece of html:

<div id="tbl"></div>

and i'm trying to create an object with the following javascript code:

var objDiv = document.getEle mentById("tbl") ;
var obj = document.create Element("object ");
With IE you might have more success with e.g.
if (typeof objDiv.insertAd jacentHTML != 'undefined') {
objDiv.insertAd jacentHTML('bef oreEnd', [
'<object id="obj_results " data="text.php" ',
' type="text/html"',
' width="500" height="300"',
'<\/object>'
].join('\r\n'));
}
of course if you need any param elements then insert them first in the
string you build and then call insertAdjacentH TML on the complete string.
On the other hand I don't see any reason to use an object element to
render a text/html document, using an iframe seems sufficient.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 14 '06 #6
thx martin for the fast and superb solution!

Martin Honnen schrieb:
ch*******@mazed lx.net wrote:

i've the following piece of html:

<div id="tbl"></div>

and i'm trying to create an object with the following javascript code:

var objDiv = document.getEle mentById("tbl") ;
var obj = document.create Element("object ");

With IE you might have more success with e.g.
if (typeof objDiv.insertAd jacentHTML != 'undefined') {
objDiv.insertAd jacentHTML('bef oreEnd', [
'<object id="obj_results " data="text.php" ',
' type="text/html"',
' width="500" height="300"',
'<\/object>'
].join('\r\n'));
}
of course if you need any param elements then insert them first in the
string you build and then call insertAdjacentH TML on the complete string.
On the other hand I don't see any reason to use an object element to
render a text/html document, using an iframe seems sufficient.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 14 '06 #7
VK wrote:
Richard Cornford wrote:
>You have never made it clear what definition you use for "bug", but
clearly it is very different from anything used in programming.
security overpass"?
LOL.

First of all, I di use the word "bug".
?
That is an "unexpected feature use"
A bug is an "unexpected feature use"?
if musted to be classified.
What are you going on about?
Secondly, you, guys, like from a time warp. A 1/3rd (at
least) of the world suffered of a virtual browser
initialized over <objecttag,
And that is relevant because?
but clj has no information about it.

Sorry to be nasty - but speechless...
You are not being nasty, you are making a fool of yourself.

Richard.

Sep 14 '06 #8

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

Similar topics

1
3171
by: putty | last post by:
I found a few posts of people asking about insertCell()/insertRow() not working in IE6 SP2, and a few others about getting "null is null or not an object" errors, but no one posted a solution anywhere or noted this tiny yet curious change in SP2.. so here it is: In IE6 SP2 rows must be inserted into a tBody instead of a Table directly, after that you may insert TDs into TRs any way you wish. insertRow() and insertCell() work the same as...
4
62206
by: millw0rm | last post by:
Hi wats wrng with this code??? it works fine on IE6 but not on FireFox 1.5??? var anOption = document.createElement("OPTION"); document.getElementById("category").options.add(anOption); anOption.innerText = "NewElement"; anOption.Value = "99";
7
11108
by: laredotornado | last post by:
Hi, Using advice from this newsgroup, I tried this JS to create new DOM elements on-the-fly var divSidebarItem = document.createElement("div"); divSideBarItem.setAttribute("class", "sidebarToDo");
2
2517
by: goodevilgenius | last post by:
I have a script that should insert a youtube video into the page. But when I ran it, the video wouldn't show up. (The script inserts a number of things, and the video was the only thing not to appear) So, I open firebug, and check the DOM. It's not in there. So, I type in "var node = document.createElement("object");" to see what was going on. It then reports node as a function, but it still has all the DOM methods and properties (appendChild,...
10
13300
RMWChaos
by: RMWChaos | last post by:
WinVista/IE7 I am getting some weird errors only in IE7, but not in FF2.0.0.8 or NN9. It even happens on this website when I click "Sign In". The error is: "A Runtime Error has occurred." "Line:xxx" "Error: Object expected" and Debug says: "Microsoft JScript runtime error: Object expected."
4
23887
by: tswaters | last post by:
Alright, so generally I'm using document.createElement("IMG").... but, I've noticed something just recently that made me switch to "new Image()" What I'm doing is creating a photo gallery of sorts, where i basically want to supply a total # of images, rows/cols max thumb/full image and let the script do the work. The solution I've opted for is to load the images once and change their size / position / visibility to show "thumb galleries" or...
7
1831
by: r_ahimsa_m | last post by:
Hello, I am learning JavaScript. I have a table on HTML page:                 <table id="announcement_fields" border="0">                 <tbody>                 <tr>                 <td><span class="obligatory">Offer type</span>:</td>                 <td>                         <select name="offer_type" onchange="ShowAnnouncementRows();">
6
4952
by: cleary1981 | last post by:
I have adapted code from http://dunnbypaul.net/js_mouse/ I want to use a button to create new draggable divs but i keep getting error "is null or not an object" heres the code <html> <head> <title>Drag and drop module</title> <style type="text/css"> #canvas {
0
8275
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
8792
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8694
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8571
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
7294
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
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1905
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
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.