This topic has been archived. It cannot be replied.
-
工作学习 / 专业知识杂谈 / Mia小妹初次报到, 先向各位请安! 希望能够得到大家的支持和帮助。我现有一个.net方面的问题,恳请高手给与指点, 先谢谢了!
我有一个div, 在javascript 里有关于此div的点击的script, 在有些情况下,我要对此功能disable, 所以我的语句是:
dayDiv.Disabled = true
此语句在internet explore works just fine, but the Firefox just does not work at all, do I need add something else for Firefox? Thanks in advance.
-patches(Mia);
2006-10-9
{337}
(#3252741@0)
-
这个明显不是.net 问题
-interview(intervieweree);
2006-10-9
(#3252992@0)
-
Thanks for your reply. This sentence: dayDiv.Disabled = true is in vb.net, if you think it is not about .net, what I can make it disable(does not allow to click)? Thanks a lot.
-patches(Mia);
2006-10-9
(#3253026@0)
-
Whatever IE can torelate doesn't imply firefox can as well. As I said, javascript is case sensitive. You have a flaw in your code.
-firebrand(Burning Wood);
2006-10-9
(#3253031@0)
-
I am not quite get it. This is the vb.net code in my vb.net script, it does not have anything about the javascript, please give more detail explanation. Thanks.
-patches(Mia);
2006-10-9
(#3253035@0)
-
javascript is case sensitive.
-firebrand(Burning Wood);
2006-10-9
(#3253012@0)
-
Yes, I know it. The thing is my vb.net code does not work in Firefox, I know you sounds weired. So, I need help. Thanks a lot.
-patches(Mia);
2006-10-9
(#3253029@0)
-
as I said over over again "case sensitive". Try "disabled". Javascript is very lousy and sensitive. A small flaw can cost you couple of hours to debug.
-firebrand(Burning Wood);
2006-10-9
(#3253034@0)
-
Maybe I did not explain it clearly, the code of dayDiv.Disabled = true is vb.net code, not javascript, the this code just work fine in IE, but firefox does not work at all, it sounds weired. So, I need help. Thanks.
-patches(Mia);
2006-10-9
(#3253041@0)
-
我非常了解你的问题了。让你去试试disabled=true,你就先去试试么。在我看来,disable一个div,怎么看都是javascript。IE能够容忍的script error,firefox不一定能够容忍。
-firebrand(Burning Wood);
2006-10-9
(#3253043@0)
-
Thanks. I have tried it, but does not work neither. Thanks a lot for your patient.
-patches(Mia);
2006-10-9
(#3253050@0)
-
by the way, do you have "javascript console" in firefox? If you do, open that console, it will telll you which javascript is wrong in which line number.
-firebrand(Burning Wood);
2006-10-9
(#3253039@0)
-
Let me explain it again. Thanks.Make it a little bit clear, I have a div, when I click it, it has a js for click event, which shows an image, but on certain situation, I do not want to disable click event, so I give a vb.net code dayDiv.disabled = true, this code(vb.net) does not work in Firefox. Did I do something wrong? or there is something else I can implenment this?
-patches(Mia);
2006-10-9
{345}
(#3253047@0)
-
IE is much forgiven as far as scripting concerned.When you tell a div disabled, it disable all children within it. But, if you want your function to work cross browsers, you have to get the specific object down the tree.
-zjosh(老俗);
2006-10-9
{170}
(#3253053@0)
-
Thanks. I know that, my purpose is to disable all the contents in the div, which works in IE, but firefox does not, is there something else I can do?
-patches(Mia);
2006-10-9
(#3253055@0)
-
Try some other waysfor example:
theDiv.style.display=’none’
or
theDiv.onclick = ;
or
for loop to disable each object
or
x = event.sourceElement
if x = something then do someothering()
-zjosh(老俗);
2006-10-9
{189}
(#3253070@0)
-
把你的source code贴出来,大家看看不就明白了?
-alittleman(凡人);
2006-10-9
(#3253081@0)
-
Thanks. Here is my source code.
-patches(Mia);
2006-10-9
{1601}
(#3253095@0)
-
You can define a var. if the browser is IE, set the value of var to your div. If it is netscape-firefox, set the value to the contents of the div. Then you can disable the var in you specified condition
-jin_ting(jy);
2006-10-9
(#3253092@0)
-
Please see my source code. Thanks.
-patches(Mia);
2006-10-9
(#3253096@0)
-
you can write JS code as i mentioned. For netscape-firefox, div as a whole cannot be 'disabled'. you have to disable its elements
-jin_ting(jy);
2006-10-9
(#3253120@0)
-
The thing is, I like to make it happen in vb.net, the div include 3 labels, how could I disable label in vb.net? Thanks.
-patches(Mia);
2006-10-9
(#3253137@0)
-
In that case, you can write JS code within your vb.net code (see inside), and disable your elements in the JS.something like this:
Dim myJS As StringBuilder = New StringBuilder()
myJS.Append("<script language='Javascript'>")
....
myJS.Append("</script>")
-jin_ting(jy);
2006-10-9
{158}
(#3253233@0)
-
Thank you so much for this reply. I tried to make it in JS, looks like it works fine. Thanks a lot for everyone trying to help me. I do appreciate it. And hope I can get answer for another question.
-patches(Mia);
2006-10-9
(#3253256@0)