Row Appended To Table Directly In Internet Explorer
Jul 19, 2010
I am making a web page, and as part of it I have a table that the user can add rows to. My code works in FF and Chrome, but IE is broken.
function addrow() {
var example=document.getElementById("new");
var addHere=document.getElementById("ticketTable");
var node= example.cloneNode(true);
node.id="added";
addHere.appendChild(node);
}
This code is called when a button is clicked. New is the ID of the row I am adding and ticketTable is the ID of the table I am adding to.
I have a task to create tables dynamically, using the javascript DOM. The current method uses a 1px x 1px IFRAME to loop through some data generation stuff, and then call JS functions in the parent window to generate the tables.
The basic idea is to add a table tag, with a thead and tbody, on the main parent page, that has display:none set. This then becomes display:block when there are rows to show. The rows themselves are added directly to the visible tbody element using appendChild(). When the results need to be refreshed, the tbody elements are removed, and then added again.
This works well in most browsers, including Opera. However, Mac IE always freezes when trying to generate the table, even for the first time.
I have several different versions, and they all generate the same issue. The tables I am creating are quite complex: multiple cells, colspans, images, nested tables, roll over colours, styles etc. At first, I believed it was an issue with creating images dynamically, however it now seems that is not the case.
I have also tried creating the table and tbody tags using the DOM and appending them to a div, but with no luck. I have also tried creating the tables using a hidden object and then copying the innerHTML / nodes across to the visible one. The various versions I have cover most bases:
* using innerHTML to add content to the cells * using the javascript DOM to create all elements and append them * using a mixture of the both
If anybody has any feedback or suggestions then it would be really appreciated, particularly related to the following:
* From your experience, is this realistically possible?
* Is the problem I'm experiencing related to the complexity or size of the table I am trying to generate? If the table is simple text only, with 2 or 3 columns and rows, then it does work.
* What is the best method to dynamically create tables and cell content across browsers, and in Mac IE?
* Is the problem image related? Does anyone have experience of creating images dynamically in tables in Mac IE? Do you use "new image()" or createElement()? (using the small table sample, this was possible using both methods, and also innerHTML on a cell).
I have a function where it add rows into a table. For the example below it adds a row under the Question column, (I have not included whole function as there is a lot of code so instead I have just posted the relevant code.
Code:
//This is inside a function var row = document.createElement("tr"); var cell input,
[code]....
Now my function works really well when it comes to adding a row into a table. The problem is that it works on all major browsers except for Internet Explorer. I have researched an found out that I may need to use insertRow() and insertCell() methods. I don't know how to really apply this into my code so what I want to know is that if somebody knows how to manipulate the code above to include the insertRows and insertCell methods, I know how insertRow() and insertCell is added in the code and I can include this in all of my other columns in the function.
I have a function where it add rows into a table. For the example below it adds a row under the Question column, (I have not included whole function as there is a lot of code so instead I have just posted the relevant code.
Code: //This is inside a function var row = document.createElement("tr");
So this works just fine in FF. In IE7 I am getting this error. I can see my content load in the background, when I hit ok it takes me to a page cannot be displayed page. If I comment out:
I'm having trouble figuring out what's going on with IE6's Msxml2.XMLHTTP object. I have two feed addresses in this stripped down version of my code below. Both work fine in Firefox (using the XMLHttpRequest object), but only the thinkgeek one works in IE. In the processFeed function, it shows the problem - the first alert shows 0 for the wikihow feed in IE, though it can still display the responseText. Any insight? Code:
i want to run a bit of js not in ie but in all others within some js i'm doing.is this the way to do it? (got this from o'reilly's js;definitive guide book):
Code: /*@cc_on @if( @_jscript ) ; // nothing for internet explorer[code]....
how should braces be in that, if they should at all? i mean if i wanted multiple lines of js code in the either non-ie or ie blocks how and where would {}'s go?also does that work for ie8?
my site seems to be working perfectly on firefox but when I access it on internet explorer everything loads fine but there is a yellow marker on the status bar of IE saying there are errors on the page. I copied the source into dreamweaver to check for browser specefic bugs but the only bugs that came up were that in Netscape. So any idea why this is happening? The link to my site is in my profile.
I am having trouble with Internet Explorer AGAIN.How do you use the setTimeout for it?This is what I am using and it is working on all of the other browser:Code:setTimeout("growContact(" + (height+20) + ")", 0);
I have a problem, and maybe someone knows the solution.
Context : - Browser : IE 6.0 - Application server : Livewire Pro - Client OS : Windows 98 SE - Server OS : NT4 - I have a frameset, including several pages, but only one will be used for the example. -------- | a | -------- | b | -------- - a form on the main page (a.html i.e.) - a data is manually typed, then I submit the form => the action will redirect to a new page (c.html) - on this new page, I do a history.go(-1), so I'm back on the a.html page, and the data is still there (it's ok) - cache parameters : "check on every page visited"
Problem : - From the main page, if a popup gives the data to the form, so after the submit and the history.go(-1), the form contains NO data !!!
So, the data is lost when the data input is not made by hand.
I have no troubles with Netscape/Mozilla, but only with IE.
I've developed a calendar program in javascript, and up until now I've done most of my testing using Mozilla and Firefox. Everything works fine, but when I try to use Internet Explorer my response time is sometimes 50 times slower than using Mozilla.
I know I haven't given you much to go by, but I'm not looking for an answer so much as an approach to debugging the problem. For example, does anyone here know of a good web site which deals with browser-specific javascript performance issues?
I am wondering if there is any way to write a VBScript macro for IE, just like the action that we can do in MS Excel (Tools -> Macro -> Visual Basic Editor).
Also, I believe we can automate actions to IE pages using VBScript, like when you right click a web page and choose "Export to Microsoft Excel". But I have no idea how to get it.
I have a shortcut on my desctop that points to web location. When a user clicks on it the Internet explorer opens the web location but without the navigation bar status,location bar address bar, but with resize handlers.
Ok, if this cannot be done is there a javascirpt that can imediatly remove this when the page is called?
Is it possible with JavaScript to prevent that a User is closing the Internet Explorer? Because it is important for me that the User pushes the cancel Button of this webapplication how can i do this?
I have a link which when clicked either fades up a full screen overlay and a popup box ontop or fades them both down. This works perfect in every browser except IE7 and IE8. The popup box fades in and out OK but the overlay just appears or disappears with no fading (which is bizarre!)
I'm new to Javascript programming. I have designed a Javascript to carry information from one page to another. It works fine in firefox but does not work in internet explorer. Is there some coding that needs to be specified for my script to work in ie?
I am using JavaScript to show/hide a floating div layer. The code i have works perfectly in Google Chrome but will not display at all in Internet Explorer.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />