Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Some javascript-generated nodes are not appearing in IE

Status
Not open for further replies.

dorobo88

Programmer
Sep 10, 2002
12
CA
here's the problem;
-click on links
-click on grphka
there's supposed to be a table node taking the text place's ( which correctly occur on nn and mozilla )

and here's the javascript code that generates the table:
function fCreateTable(name) {
//======table
oNodeMgr.tableNodeArr[name] = document.createElement("table");
oNodeMgr.tableNodeArr[name].style.width = "396px";
//======1er tr
temptr1 = document.createElement("tr");
//======1er td
temptd4 = document.createElement("td");
temptd4.style.height = "15px";
temptd4.style.width = "396px";
temptd4.colspan = "2";

temptr1.appendChild(temptd4);
//======2e tr
temptr2 = document.createElement("tr");
//======1er td
temptd1 = document.createElement("td");
temptd1.style.height = "46px";
temptd1.style.width = "108px";
temptd1.style.verticalAlign = "middle";
temptd1.style.textAlign = "center";
tempimg1 = document.createElement("img");
tempimg1.src = oImgMgr.imgArr["deviantart"].src;
temptd1.appendChild(tempimg1);
//======2e td
temptd2 = document.createElement("td");
temptd2.style.height = "46px";
temptd2.style.width = "288px";
temptd2.style.verticalAlign = "middle";
temptd2.style.textAlign = "left";
temptd2.className = "common";
tempa1 = document.createElement("a");
tempa1.href = " tempa1.target = "_blank";
temptxt1 = document.createTextNode("deviantArt.com");
tempa1.appendChild(temptxt1);
temptd2.appendChild(tempa1);

temptr2.appendChild(temptd1);
temptr2.appendChild(temptd2);

//======3e tr
temptr3 = document.createElement("tr");
//======1er td
temptd1 = document.createElement("td");
temptd1.style.width = "396px";
temptd1.colspan = "2";
temptr3.appendChild(temptd1);

oNodeMgr.tableNodeArr[name].appendChild(temptr1);
oNodeMgr.tableNodeArr[name].appendChild(temptr2);
oNodeMgr.tableNodeArr[name].appendChild(temptr3);

return null;
}

and strangely,
-click on wallpapers
-click on algopolis
is correctly working in every browsers

thks in advance for any tips
 
no you cannot edit your posts. All the stupid mistakes we make here are for ever engraved in the web for everyone to see. Soon there will be a hall of shame where all our stupidities are praised (or laughed at) with a giant picture of us at the best of our form (puking in the gutter).

Enough of that. J'ai deux erreurs :

Line 19
Char 20
Unterminated string constant


Ligne 43
Character 3
invalid argument

I don't know what exactly is happening or not happening.

Where are you based ou of? I'm in France right now.
Gary Haran
 
montréal based :)

got mozilla or netscape 6 or 7 installed? They yield what's supposed to happen, meaning a table with an image and a link to deviantart.com

btw, how do you troubleshoot ie's javascript?
 
The 1st error "Unterminated String" is because you have:

monthArr[7] = "ao��

you need to do monthArr[7] = "ao��";

That should take care of your first error and may take care of your 2nd error, sometimes the errors just trickle down causing havoc in all your code. "did you just say Minkey?, yes that's what I said."

MrGreed
 
Your Invalid Error;

Might have something to do with this line:

temptd2.style.width = "80%px"

I suspect because of the "%" percent sign. "did you just say Minkey?, yes that's what I said."

MrGreed
 
this disDate() function replacement might come in handy :

function disDate()
{
var d = new Date();
return ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"][d.getDay()]
+ d.getDate()
+ " "
+ ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"][d.getMonth()]
+ ", "
+ ((d.getHours() < 10) ? &quot;0&quot; + d.getHours() + &quot;:&quot; : d.getHours() + &quot;:&quot;)
+ ((d.getMinutes() < 10) ? &quot;0&quot; + d.getMinutes() + &quot;:&quot; : d.getMinutes() + &quot;:&quot;)
+ ((d.getSeconds() < 10) ? &quot;0&quot; + d.getSeconds() : d.getSeconds())
} Gary Haran
 
woah, thks for this optimized version xutopia :)
put still no luck at displaying the table, here's the correct code i'm using:

function fCreateTable(name) {
//======table
oNodeMgr.tableNodeArr[name] = document.createElement(&quot;table&quot;);
oNodeMgr.tableNodeArr[name].style.width = &quot;396px&quot;;
//======1er tr
temptr1 = document.createElement(&quot;tr&quot;);
//======1er td
temptd4 = document.createElement(&quot;td&quot;);
temptd4.style.height = &quot;15px&quot;;
temptd4.style.width = &quot;396px&quot;;
temptd4.colspan = &quot;2&quot;;

temptr1.appendChild(temptd4);
//======2e tr
temptr2 = document.createElement(&quot;tr&quot;);
//======1er td
temptd1 = document.createElement(&quot;td&quot;);
temptd1.style.height = &quot;46px&quot;;
temptd1.style.width = &quot;20%&quot;;
temptd1.style.verticalAlign = &quot;middle&quot;;
temptd1.style.textAlign = &quot;center&quot;;
tempimg1 = document.createElement(&quot;img&quot;);
tempimg1.src = oImgMgr.imgArr[&quot;deviantart&quot;].src;
temptd1.appendChild(tempimg1);
//======2e td
temptd2 = document.createElement(&quot;td&quot;);
temptd2.style.height = &quot;46px&quot;;
temptd2.style.width = &quot;80%&quot;;
temptd2.style.verticalAlign = &quot;middle&quot;;
temptd2.style.textAlign = &quot;left&quot;;
temptd2.className = &quot;common&quot;;
tempa1 = document.createElement(&quot;a&quot;);
tempa1.href = &quot; tempa1.target = &quot;_blank&quot;;
temptxt1 = document.createTextNode(&quot;deviantArt.com&quot;);
tempa1.appendChild(temptxt1);
temptd2.appendChild(tempa1);

temptr2.appendChild(temptd1);
temptr2.appendChild(temptd2);

//======3e tr
temptr3 = document.createElement(&quot;tr&quot;);
//======1er td
temptd1 = document.createElement(&quot;td&quot;);
temptd1.style.width = &quot;396px&quot;;
temptd1.colspan = &quot;2&quot;;
temptr3.appendChild(temptd1);

oNodeMgr.tableNodeArr[name].appendChild(temptr1);
oNodeMgr.tableNodeArr[name].appendChild(temptr2);
oNodeMgr.tableNodeArr[name].appendChild(temptr3);

return null;
}

and I've replaced my disDate() function by xutopia's one
 
xutopia,
sorry to sound so retarted, but where can i find that? :)
 
you don't sound retarded. &quot;Better is he who asks once and looks stupid five minutes than he who never asked and fell in the pit.&quot; src : adaptation of an old chinese proverb.

By the way never go to chinatown in montreal!!!! never!! LOL

The .js files you are using :

cMenuMgr.js
cNodeMgr.js
cImgMgr.js

They are a bit complicated but look as though you should leave them as is and not change them at all. Are these taken from another site? I'd like to have some documentation on them.
Gary Haran
 
I need a beer. Where's my maudite tabarnak!!

I'm having trouble understanding what you are trying to do with your code (and I have a feeling I can help you make the code more manageable) could you tell me in big lines what cMenuMgr, cNodeMgr and cImgMgr do?

Documentation would come in handy here! It could make your code helpful for others to use as well! :) Gary Haran
 
well
cMenuMgr manages to menu tree on the right
cNodeMgr manages everything related to nodes, especially replacing for more efficient dynamic content
cImgMgr is use to create Images object and storring them in an array
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top