LinkButton cann't work [modified]
-
I don't know why all the LinkButton in my C#.net website cann't work, It means that if i clicked the button just like i have nothing to do with it. Can someone help me?waiting online the browser has not any problem. Now i know what cause this problem,but i don't know how to solve. my website reference a outside javascript file,the file content is:
// JScript 文件
var imgObj;
function showImage(imgsrc)
{
if(imgObj!=null) {
document.body.removeChild(imgObj);
}
imgObj=document.createElement("div");//消息层
imgObj.setAttribute("id","imgDiv");
imgObj.setAttribute("align","center");
imgObj.style.border="0";
imgObj.style.position="absolute";
var X=event.x;
if(X<=screen.width*41/100)
X=X+100;
else if(X>=screen.width*59/100)
X=X-200-350;
else
X=screen.width*59/100;
imgObj.style.left=X;
imgObj.style.top="30%";
imgObj.style.marginTop=-75+document.documentElement.scrollTop+"px";
imgObj.style.zIndex="1000";
imgObj.innerHTML="<img src='"+imgsrc+"' onerror='return true' height=400 width=350 />";
document.body.appendChild(imgObj);
}
function hideImage()
{
document.body.removeChild(imgObj);
imgObj=null;
}this script is to show the bigger image onmouseover,but i don't know why it can cause this problem.
modified on Saturday, March 14, 2009 10:05 PM
-
I don't know why all the LinkButton in my C#.net website cann't work, It means that if i clicked the button just like i have nothing to do with it. Can someone help me?waiting online the browser has not any problem. Now i know what cause this problem,but i don't know how to solve. my website reference a outside javascript file,the file content is:
// JScript 文件
var imgObj;
function showImage(imgsrc)
{
if(imgObj!=null) {
document.body.removeChild(imgObj);
}
imgObj=document.createElement("div");//消息层
imgObj.setAttribute("id","imgDiv");
imgObj.setAttribute("align","center");
imgObj.style.border="0";
imgObj.style.position="absolute";
var X=event.x;
if(X<=screen.width*41/100)
X=X+100;
else if(X>=screen.width*59/100)
X=X-200-350;
else
X=screen.width*59/100;
imgObj.style.left=X;
imgObj.style.top="30%";
imgObj.style.marginTop=-75+document.documentElement.scrollTop+"px";
imgObj.style.zIndex="1000";
imgObj.innerHTML="<img src='"+imgsrc+"' onerror='return true' height=400 width=350 />";
document.body.appendChild(imgObj);
}
function hideImage()
{
document.body.removeChild(imgObj);
imgObj=null;
}this script is to show the bigger image onmouseover,but i don't know why it can cause this problem.
modified on Saturday, March 14, 2009 10:05 PM
1 - See the event handlers are hooked correctly. 2 - Take the viewsource of that page and see how it is rendered. 3 - Make sure you have JS enabled browser. :)
Navaneeth How to use google | Ask smart questions
-
I don't know why all the LinkButton in my C#.net website cann't work, It means that if i clicked the button just like i have nothing to do with it. Can someone help me?waiting online the browser has not any problem. Now i know what cause this problem,but i don't know how to solve. my website reference a outside javascript file,the file content is:
// JScript 文件
var imgObj;
function showImage(imgsrc)
{
if(imgObj!=null) {
document.body.removeChild(imgObj);
}
imgObj=document.createElement("div");//消息层
imgObj.setAttribute("id","imgDiv");
imgObj.setAttribute("align","center");
imgObj.style.border="0";
imgObj.style.position="absolute";
var X=event.x;
if(X<=screen.width*41/100)
X=X+100;
else if(X>=screen.width*59/100)
X=X-200-350;
else
X=screen.width*59/100;
imgObj.style.left=X;
imgObj.style.top="30%";
imgObj.style.marginTop=-75+document.documentElement.scrollTop+"px";
imgObj.style.zIndex="1000";
imgObj.innerHTML="<img src='"+imgsrc+"' onerror='return true' height=400 width=350 />";
document.body.appendChild(imgObj);
}
function hideImage()
{
document.body.removeChild(imgObj);
imgObj=null;
}this script is to show the bigger image onmouseover,but i don't know why it can cause this problem.
modified on Saturday, March 14, 2009 10:05 PM
sohighthesky wrote:
the browser has not any problem.
No, the odds seem low of the browser being broken. Your code obviously is. So, do some basic error checking, and if you need to ask again, try giving us some detail of what is happening, and show us code. This post is utterly useless. You've said to us 'my code is broken'. Great. How can we help without seeing it, or without you doing some basic work to check what is and is not working as you'd expect ?
Christian Graus Driven to the arms of OSX by Vista.