LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   javascript poblum on fedora (https://www.linuxquestions.org/questions/linux-newbie-8/javascript-poblum-on-fedora-724098/)

sriphp 05-06-2009 05:14 AM

javascript poblum on fedora
 
Hai all,

this is srinath.m

in my php file javascript is not funtioning porerly on fedore but in windows it worked sucessfully.

i am using dropdown box using div. it is working in windows but not in fedora

also javascript 'this' operator and object are not working in some areas.

please help me below is my code segment.

<?php

session_start();

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<link rel="stylesheet" type="text/css" href="styles/panelHeading.css" />

<script type="text/javascript">

var dropboxleft=0 //set left position of box (in px)

var dropboxtop=0 //set top position of box (in px)

var dropspeed=15 //set speed of drop animation (larger=faster)

var displaymode="always"



///Don't edit beyond here///////////



if (parseInt(displaymode)!=NaN)

var random_num=Math.floor(Math.random()*displaymode)

var ie=document.all

var dom=document.getElementById



function initboxv2(l,h){



var ob = document.getElementById("mine");

//var l = getxPosition(ob);

//var h = getyPosition(ob);

//alert(l+ " "+h);

//this.get_mouse_pointer_coordinates(e);



this.dropboxleft = this.posx - 202;

this.dropboxtop = this.posy - 171;



if (!dom&&!ie)

return

crossboxcover=(dom)?document.getElementById("dropinboxv2cover") : document.all.dropinboxv2cover

crossbox=(dom)?document.getElementById("dropinboxv2"): document.all.dropinboxv2

scroll_top=(ie)? truebody().scrollTop : window.pageYOffset

crossbox.height=crossbox.offsetHeight

crossboxcover.style.height=parseInt(crossbox.height)+"px"

crossbox.style.top=crossbox.height*(-1)+"px"

crossboxcover.style.left=dropboxleft+"px"

crossboxcover.style.top=dropboxtop+"px"

crossboxcover.style.visibility=(dom||ie)? "visible" : "show"

dropstart=setInterval("dropinv2()",50)

}



function dropinv2(){

scroll_top=(ie)? truebody().scrollTop : window.pageYOffset

if (parseInt(crossbox.style.top)<0){

crossboxcover.style.top=scroll_top+dropboxtop+"px"

crossbox.style.top=parseInt(crossbox.style.top)+dropspeed+"px"

}

else{

clearInterval(dropstart)

crossbox.style.top=0

}

}



function dismissboxv2(){

if (window.dropstart) clearInterval(dropstart)

crossboxcover.style.visibility="hidden"

}



function truebody(){

return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body

}



function get_cookie(Name) {

var search = Name + "="

var returnvalue = ""

if (document.cookie.length > 0) {

offset = document.cookie.indexOf(search)

if (offset != -1) {

offset += search.length

end = document.cookie.indexOf(";", offset)

if (end == -1)

end = document.cookie.length;

returnvalue=unescape(document.cookie.substring(offset, end))

}

}

return returnvalue;

}

function posit(evt)

{ if (!evt) evt = window.event;this.posx = evt.clientX; this.posy = evt.clientY;}


</script>
</head>
<body>

<table><tr><td>

<table id="tblLower"><tr><td><font style="font-size:8pt"><b>Select</b></font></td>

</tr></table></td><td>

<div id='mine' class='dropheadlink' onmouseup='posit(this.event);' onclick='initboxv2(482,238);'><script type="text/javascript">this.mine.innerHTML = this.comboTitle("More Options&nbsp;"+"<img style='vertical-align:text-top;' src='images/simbol2.jpg'>");</script></div>

</td></tr></table>

<div id="dropinboxv2cover">

<div id="dropinboxv2">

<div id="more">More Actions</div>

<div id="delete" onClick="javascript: oMailbox.checkSelectOptions('1');dismissboxv2();return false">Delete</div>

<div id="masread" onClick="javascript: oMailbox.checkSelectOptions('2');dismissboxv2();return false">Mark As Read</div>

<div id="masunread" onClick="javascript: oMailbox.checkSelectOptions('3');dismissboxv2();return false">Mark As UnRead</div>

<div id="adstar" onClick="javascript: oMailbox.checkSelectOptions('4');dismissboxv2();return false">Add Star</div>

<div id="masunstar" onClick="javascript: oMailbox.checkSelectOptions('5');dismissboxv2();return false">Remove Star</div><br>

<div style="text-align: center;width:90px;"><a href="#" onClick="dismissboxv2();return false"><img border="0" src="images/close2.jpg"></a></div><br>

</div>

</div>

</body>

in external panelHeading.css file css rules are like

.dropheadlink

{

text-decoration: none;

position: relative;

}

your_shadow03 05-06-2009 05:27 AM

I can see lots of spelling mistakes which everyone associated with this forum and other would find difficult reading.
Can you please perform spell-check in Open Office org?

linuxlover.chaitanya 05-06-2009 05:43 AM

Did you check it on windows using IE or with firefox? Javascript is client side and hence dependent on client browser. I have seen this issue arising a lot of times.
If you are running FireFox on Fedora, then cross check if you have got noscript plugin installed? If it is installed then disable it for time being and then recheck it.

sriphp 05-06-2009 06:55 AM

javascript problum on fedora
 
hai,

yes i am using fire fox on fedora

in windows IE it is working

where to cross check noscript plugin installed or not

please tell me i will try

Thanks
Srinath.M

linuxlover.chaitanya 05-06-2009 08:26 AM

By default noscript plugin is not installed. But you might just want to be sure that it is not installed. You might also want to search google for browser independent script for your purpose. It might just give you some idea.

Edit:
I asked one of the developers at my office and he confirmed that there are scripts that he has come across that will not run as desired on all the browsers though the script is ok in programmer's view. That may happen if different browsers act differently on same javascript. You can wait for some java expert to come and elaborate on this.


All times are GMT -5. The time now is 01:03 PM.