/    Sign up×
Community /Pin to ProfileBookmark

JavaScript: Problem with code on IE

Hello everyone!

I have a function with mixed js and php code. It is plased in file change.php

[CODE]
function zrob_tabele() {
var xx1=x-4;
var yy1=y-4;
var xx=x+9-4;
var yy=y+9-4;
mytable = document.createElement(“TABLE”);
mytablebody = document.createElement(“TBODY”);
for(j=yy1;j<yy;j++) {
mycurrent_row=document.createElement(“TR”);
for(i=xx1;i<xx;i++) {
mycurrent_cell=document.createElement(“TD”);
if(i<1 || i>40 || j<1 || j>40) {
mycurrent_cell.setAttribute(“bgcolor”, “black”);
currenttext=document.createTextNode(‘ ‘);

}else {
mycurrent_cell.setAttribute(“background”, “trawa.gif”);
mycurrent_cell.onclick = function () { show_info(event, 1, 100,100); };
mycurrent_cell.onmousemove = function () { show_info(event, 1, 100,100); };
mycurrent_cell.onmouseout = function () { show_info(event, 2, 100,100); };
currenttext=document.createTextNode(”);
mycurrent_cell.setAttribute(“id”, j+’-‘+i);
}
mycurrent_cell.setAttribute(“width”,”<? echo $szerokosc; ?>”);
mycurrent_cell.setAttribute(“height”,”<? echo $wysokosc; ?>”);

mycurrent_cell.appendChild(currenttext);
mycurrent_row.appendChild(mycurrent_cell);
}
mytablebody.appendChild(mycurrent_row);
}
mytable.appendChild(mytablebody);

mytable.setAttribute(“border”,”0″);
mytable.setAttribute(“width”,”<? echo $ile_pol*40; ?>”);
mytable.setAttribute(“cellspacing”,”0″);
mytable.setAttribute(“cellpadding”,”0″);
mytable.setAttribute(“style”,”border-top: 1px solid; border-bottom: 1px solid; border-left: 1px solid; border-right: 1px solid; border-color: black”);
mytable.setAttribute(“id”,”plansza_small”);
self.parent.usun_tabele(‘dss’);
self.parent.pokaz(mytable);
}[/CODE]

in other file i have other function

[CODE]function pokaz(x) {
var mybody=document.getElementsByTagName(“div”).item(0);
mybody.appendChild(x);
}[/CODE]

when i load this script on Fire Fox then everything works fine, but when i load it on IE then an error appears on function pokaz() that there is a wrong argument.

Can someone help and tell me whats wrong?

Thanks in advance!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@JoeyGAug 16.2005 — Here's a quick three-step process:

1) Download a few other browsers (Opera, Mozilla, Netscape for PC, iCab for Mac)

2) Test your page on those. iCab is perfect from my experience, so if it works there your code is fine.

3) If errors appear, find the Javascript debugger (it's the red sad-face in iCab, and Tools->Javscript Console in Firefox/Netscape). Otherwise, you'll need to warn IE users that your site doesn't work with their crappy browser.



EDIT: Post any errors you find with the Javscript debuggers, which will assist in us helping you.
Copy linkTweet thisAlerts:
@pitiopiaauthorAug 17.2005 — In Opera i have this error in JavaScript console:


http://localhost/~gra/change.php?x=1&y=1

Event thread: load

Unhandled exception: [Object DOMException][/QUOTE]


And on Mozilla is all fine.

I think this problem is connected with sending parameters between files, cause when i copy those functions to one file there are some differences but the table appears.
×

Success!

Help @pitiopia spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...