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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

my javascript problamatic in IE

Status
Not open for further replies.

orkun

Programmer
Apr 23, 2010
1
TR
hello

my javascript doesn't run in IE but runs in firefox.

what should I do to make it run in IE ?

Do you have any suggestion ?
<script type="text/javascript">
var xoffset = 0;
var yoffset = 0;

var width;
height;

var xx;
var yy;

function first() {

// Burada bir alert 'Burday?m gibi'

if (document.getElementById) {
img = document.getElementById('harita:imgMap');
if (img.style) {

xoffset = img.style.left;
yoffset = img.style.top;

return;

} else {
alert('hata first: img.style');
}

} else {
alert('hata first first:document.getElementById');
}

if (document.all) {
imgall = document.all['harita:imgMap'];
if (imgall.style) {

xoffset = imgall.style.left;
yoffset = imgall.style.top;
return;

} else {
alert('hata first: imgall.style');
}

}
// return ???
}

function startRubber(evt) {

// Burada bir alert 'Burday?m gibi'

first();

var myReference = null;
if (document.getElementById) { // buras? firefox a uyar Ya explorer
myReference = document.getElementById('harita:rubberBand');

} else {
alert('hata startRubber:document.getElementById');
}
if (myReference.style) {
//DOM & proprietary DOM
myReference.style.width = 0;
myReference.style.height = 0;
myReference.style.left = (evt.clientX) + 'px';
myReference.style.top = (evt.clientY) + 'px';

myReference.style.visibility = 'visible';

var xx = new Number(evt.clientX - parseInt(xoffset));
var yy = new Number(evt.clientY - parseInt(yoffset));

xx = xx.toFixed(3);
yy = yy.toFixed(3);

upperleft_koord(xx, yy);

} else {
alert(' hata startRubber:myReference.style');
}
document.onmousemove = moveRubber;

return;

}

function moveRubber(evt) {

if (document.getElementById) { // buras? firefox a uyar // explorer ???
myReference = document.getElementById('harita:rubberBand');
myReference.style.width = (evt.clientX - parseInt(myReference.style.left)) + 'px';
myReference.style.height = (evt.clientY - parseInt(myReference.style.top)) + 'px';

width = parseInt(myReference.style.width);
height = parseInt(myReference.style.height);

} else {
alert(' hata moveRubber document.getElementById');
}

myReference.onmouseup = stopRubber;

return;
} //moveRubber

function stopRubber() {
myReference.style.visibility = 'hidden';
myReference = null;
document.onmousemove = null;
if (document.getElementById('harita:rect_zoom')) {
document.getElementById('harita:rect_zoom').value = '0';
document.getElementById('harita:zoom_rect').src = './images/zoom_rect.png';

} else {
alert('hata stopRubber() document.getElementById(harita:rect_zoom ');
}

width_height(width, height);
return;
//document.forms['harita'].submit();
} //stopRubber

//document.onmousedown = startRubber;
//document.onmouseup = stopRubber;

function koord_click(event) {
first();
fm = 'harita';
img = document.getElementById(fm + ':harita1');

if (img) {
xx = 0;
yy = 0;
xx = event.clientX - parseInt(xoffset);
yy = event.clientY - parseInt(yoffset); // bu de?erler de?i?ebilir
xx = xx.toFixed(3);
yy = yy.toFixed(3);

document.getElementById(fm + ':img_clicked').value = '1';

img_clickxy(xx, yy);

if (document.getElementById('harita:info_in').value == '1') {
document.getElementById('harita:info_in').value == '0'
javascript: Richfaces.showModalPanel('harita:infomodalPanel');
}

return;

} else {
alert(' img tan?ms?z' + img);
}

} //koord_click

function zoom_rect() {

if (document.getElementById) {

document.getElementById('harita:zoom_rect').src = './images/zoom_rect_gray.png';

if (document.getElementById('harita:rect_zoom').value == '0') {
document.getElementById('harita:rect_zoom').value = '1';
document.getElementById('harita:info_in').value = '0';
document.getElementById('harita:infobutton').src = './images/Info24.png';
}
return;
} else {
alert('hata zoom_rect() document.getElementById tan?ms?z');
}

return;
}
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top