Click here to Skip to main content
15,880,330 members
Home / Discussions / Web Development
   

Web Development

 
QuestionUsing Class Libraries-Few Problems Pin
adnanrafiq1-Feb-07 21:17
adnanrafiq1-Feb-07 21:17 
AnswerRe: Using Class Libraries-Few Problems Pin
Michael P Butler1-Feb-07 21:53
Michael P Butler1-Feb-07 21:53 
GeneralRe: Using Class Libraries-Few Problems Pin
adnanrafiq1-Feb-07 22:55
adnanrafiq1-Feb-07 22:55 
AnswerRe: Urgent : Help!!!!!!!!!!!!!!!!! Pin
Bradml1-Feb-07 22:24
Bradml1-Feb-07 22:24 
QuestionCall Java Code from C# Pin
Expert Coming1-Feb-07 16:08
Expert Coming1-Feb-07 16:08 
AnswerRe: Call Java Code from C# Pin
Christian Graus1-Feb-07 16:52
protectorChristian Graus1-Feb-07 16:52 
GeneralRe: Call Java Code from C# Pin
Expert Coming1-Feb-07 20:41
Expert Coming1-Feb-07 20:41 
QuestionJavascript Problem! Pin
Rojan Gh.1-Feb-07 12:31
professionalRojan Gh.1-Feb-07 12:31 
Hi everyone,
I have an Asp.net that has some Javascripts and so when I use the ie png transparency hacks, this scripts would not work correctly so wrote this for myself:
<br />
var elements = document.body.all[i];<br />
        for(i = 0; i < elements.length; i++){<br />
            var element = elements[i];<br />
            if(element.style.backgroundImage){<br />
                var BackgroundImage = new String();<br />
                BackgroundImage = element.style.backgroundImage;<br />
                if(BackgroundImage.toLowerCase().indexOf('.png',0) != -1){<br />
                    var ImageAddress = new String();<br />
                    ImageAddress = BackgroundImage.substr(BackgroundImage.toLowerCase().indexOf('(',0), BackgroundImage.toLowerCase().indexOf(')',0) - 1);<br />
                    element.style.backgroundImage = 'none';<br />
                    ImageAddress = ImageAddress.substring(1,ImageAddress.length - 1);<br />
                    element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + ImageAddress + '\', sizingMethod=\'scale\');';<br />
                }<br />
            }<br />
        }<br />

It works nice and fixes the png transparency in ie but when it runes and does it's job, the page elements like buttons and even the onclick events of the td tags seems to be disabled and do not response! I tried to find the problem point and I tested some different codes and I achieved the point makes this problem.
I started testing different tags like this:
var elements = document.body.getElementsByTagName("table");<br />
        for(i = 0; i < elements.length; i++){<br />
            var element = elements[i];<br />
            if(element.style.backgroundImage){<br />
                var BackgroundImage = new String();<br />
                BackgroundImage = element.style.backgroundImage;<br />
                if(BackgroundImage.toLowerCase().indexOf('.png',0) != -1){<br />
                    var ImageAddress = new String();<br />
                    ImageAddress = BackgroundImage.substr(BackgroundImage.toLowerCase().indexOf('(',0), BackgroundImage.toLowerCase().indexOf(')',0) - 1);<br />
                    element.style.backgroundImage = 'none';<br />
                    ImageAddress = ImageAddress.substring(1,ImageAddress.length - 1);<br />
                    element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + ImageAddress + '\', sizingMethod=\'scale\');';<br />
                }<br />
            }<br />
        }

And I found out that when it goes this way:
var elements = document.body.getElementsByTagName("td");<br />
        for(i = 0; i < elements.length; i++){<br />
            var element = elements[i];<br />
            if(element.style.backgroundImage){<br />
                var BackgroundImage = new String();<br />
                BackgroundImage = element.style.backgroundImage;<br />
                if(BackgroundImage.toLowerCase().indexOf('.png',0) != -1){<br />
                    var ImageAddress = new String();<br />
                    ImageAddress = BackgroundImage.substr(BackgroundImage.toLowerCase().indexOf('(',0), BackgroundImage.toLowerCase().indexOf(')',0) - 1);<br />
                    element.style.backgroundImage = 'none';<br />
                    ImageAddress = ImageAddress.substring(1,ImageAddress.length - 1);<br />
                    element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + ImageAddress + '\', sizingMethod=\'scale\');';<br />
                }<br />
            }<br />
        }

the page elements would not response any more!

Could anyone tell me why?WTF | :WTF:

Sojaner!

QuestionCreating a sweepstakes popup / storing emails in DB Pin
therick01451-Feb-07 10:58
therick01451-Feb-07 10:58 
AnswerRe: Creating a sweepstakes popup / storing emails in DB Pin
therick01451-Feb-07 11:01
therick01451-Feb-07 11:01 
AnswerRe: Creating a sweepstakes popup / storing emails in DB Pin
Christian Graus1-Feb-07 11:18
protectorChristian Graus1-Feb-07 11:18 
GeneralRe: Creating a sweepstakes popup / storing emails in DB Pin
Bradml1-Feb-07 22:22
Bradml1-Feb-07 22:22 
GeneralRe: Creating a sweepstakes popup / storing emails in DB Pin
therick01452-Feb-07 6:51
therick01452-Feb-07 6:51 
GeneralRe: Creating a sweepstakes popup / storing emails in DB Pin
Bradml2-Feb-07 10:54
Bradml2-Feb-07 10:54 
Questiononchange with select tags Pin
spinanicky1-Feb-07 8:46
spinanicky1-Feb-07 8:46 
AnswerRe: onchange with select tags Pin
Rojan Gh.1-Feb-07 12:50
professionalRojan Gh.1-Feb-07 12:50 
Questionvisual studio 2005 issue Pin
Shaimmaa1-Feb-07 6:02
Shaimmaa1-Feb-07 6:02 
AnswerRe: visual studio 2005 issue Pin
Christian Graus1-Feb-07 9:43
protectorChristian Graus1-Feb-07 9:43 
QuestionCMMI Pin
Member 37855611-Feb-07 5:48
Member 37855611-Feb-07 5:48 
QuestionWeb service issues Pin
Parmenio1-Feb-07 2:09
Parmenio1-Feb-07 2:09 
AnswerRe: Web service issues Pin
parsiphal1-Feb-07 3:46
parsiphal1-Feb-07 3:46 
QuestionJavascript Copy Text Pin
tech_freak1-Feb-07 1:49
tech_freak1-Feb-07 1:49 
AnswerRe: Javascript Copy Text Pin
Vasudevan Deepak Kumar1-Feb-07 3:52
Vasudevan Deepak Kumar1-Feb-07 3:52 
AnswerRe: Javascript Copy Text Pin
David Domingues1-Feb-07 5:44
David Domingues1-Feb-07 5:44 
Questionddl with grid Pin
praveenanand31-Jan-07 20:00
praveenanand31-Jan-07 20:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.