Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Javascript Gallery Compatibility Issue

JavaScript

  • Please log in to reply
5 replies to this topic

#1 JackomoLight

JackomoLight

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 97 posts
  • Programming Language:PHP, Python, JavaScript, PL/SQL
  • Learning:C, Java, C++, Perl, Ruby, Lisp, Bash

Posted 04 May 2012 - 02:55 AM

Hello guys. I have a problem with a JavaScript GALLERY which you can find on this link: http://nettuts.s3.am...lery/index.html

The problem is such that when you try to see it under Internet Explorer 9 it just doesn't work unless you go into compatibility mode which is unacceptable and annoying.

Any suggestions are greatly appreciated. Thanks
  • 0

#2 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1310 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 04 May 2012 - 09:51 AM

Have you tried replacing this:
return $.element(this.createElement(A)).set(<img src='http://forum.codecall.net/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />;
with this?:
return $.element(this.createElement("A")).set(<img src='http://forum.codecall.net/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />;
or this?:
return $.element(this.createElement("a")).set(<img src='http://forum.codecall.net/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />;

And also, what's 'B' ? Is that supposed to be '"B"' , or is it 'B' ?

...

After looking at the code a little more, I noticed that you're trying to make an element using HTML; if you want to do that, rather do something more like this:
var div1= document.createElement ("div"); 
div1.innerHTML= A;
That would make an element and insert your HTML into it. If you rather prefer to use DOM, this should work:
var a= document.createElement ("input"); 
a.type= "checkbox"; 
a.name= "name01"; 
a.id= "the_id_1"; 
a.checked= true; 
...


Here's a bit of the code lines surrounding that line of code:
Posted Image
  • 3
Regards,
RR

#3 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 04 May 2012 - 03:07 PM

Sorry i got late on this, RethoricalRuvim just aced it !

any other trouble just make us know
  • 0

#4 Static

Static

    CC Newcomer

  • New Member
  • PipPip
  • 10 posts
  • Programming Language:C, C++, C#, PHP, (Visual) Basic, Python, JavaScript, Perl, Ruby, Visual Basic .NET, Lua, ActionScript, Haskell, VBScript
  • Learning:C, Bash, Others

Posted 05 May 2012 - 04:57 AM

Have you tried replacing this:

return $.element(this.createElement(A)).set(<img src='http://forum.codecall.net/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />;
with this?:
return $.element(this.createElement("A")).set(<img src='http://forum.codecall.net/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />;
or this?:
return $.element(this.createElement("a")).set(<img src='http://forum.codecall.net/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />;

And also, what's 'B' ? Is that supposed to be '"B"' , or is it 'B' ?

...

After looking at the code a little more, I noticed that you're trying to make an element using HTML; if you want to do that, rather do something more like this:
var div1= document.createElement ("div");
div1.innerHTML= A;
That would make an element and insert your HTML into it. If you rather prefer to use DOM, this should work:
var a= document.createElement ("input");
a.type= "checkbox";
a.name= "name01";
a.id= "the_id_1";
a.checked= true;
...


Here's a bit of the code lines surrounding that line of code:
Posted Image

Impressive!
  • 0

#5 JackomoLight

JackomoLight

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 97 posts
  • Programming Language:PHP, Python, JavaScript, PL/SQL
  • Learning:C, Java, C++, Perl, Ruby, Lisp, Bash

Posted 05 May 2012 - 05:06 AM

Thanks RhetoricaRuvim, it did excellent job. Btw how did you figure it out? I had no idea how to go about it in a good way.
  • 0

#6 RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1310 posts
  • Location:C:\Countries\US
  • Programming Language:C, Java, C++, PHP, Python, JavaScript

Posted 05 May 2012 - 08:27 AM

Well, pressing the F12 key in Internet Explorer 9 opens the debugger window. I first figured out where the error was, and then, since the code is not very easy to read, I went to that same page in Google Chrome, opened the F12 script, used the 'Pretty print' button (which made everything in that script more readable), found where that same place in the code is, and looked at it.
  • 1
Regards,
RR





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download