6 Replies - 389 Views - Last Post: 24 August 2013 - 05:44 PM

#1 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Debugging?

Posted 23 August 2013 - 04:49 PM

Hello friends hope all is well i guess...

I have code that works great in safari but the .jpg images don't appear in chrome... (it appears with a box outline and a '?' i think) (they are images infused with javascript)

I guess this is an age old question "how do you get your code running in all browsers"?

<!--[if lt IE 9,]>
<script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

I know there are 'if statements' like this that change the code output but how do you know beforehand?


Is this what firebug is for? Building it in one browser then using a debugger so it runs in other browsers?

All tips welcome thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Debugging?

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3710
  • View blog
  • Posts: 5,958
  • Joined: 08-June 10

Re: Debugging?

Posted 23 August 2013 - 05:07 PM

View Postjimbang, on 23 August 2013 - 11:49 PM, said:

I have code that works great in safari but the .jpg images don't appear in chrome

Probably a problem with the file paths. Not sure what the differences between Safari and Chrome would be in that department, but since it's a Apple browser there probably are some.

Show us the code and we might be able to help.

View Postjimbang, on 23 August 2013 - 11:49 PM, said:

(they are images infused with javascript)

How do you mean?

View Postjimbang, on 23 August 2013 - 11:49 PM, said:

I know there are 'if statements' like this that change the code output but how do you know beforehand?

Those are only for Internet Explorer. All the other browsers ignore them as normal comments. (Which they are.) Microsoft just added them for IE because IE8 and lower had no concept of standards compliance, and people needed a way to add IE-only code blocks to fix IE's rendering issues.

View Postjimbang, on 23 August 2013 - 11:49 PM, said:

Is this what firebug is for? Building it in one browser then using a debugger so it runs in other browsers?

No, it's not. Firebug is the Firefox developer console. It debugs code running in Firefox. All the other browsers have their own, built-in versions of Firebug.


If you want to make your code ruing in all the popular browsers, you need to stick as close to the standards as possible, and then - if necessary - just add browser-specific fixes to fix whatever deviations from the standard exists in each browser. If one browser is misbehaving, debug the problem using that browser's developer tools. (Usually just need to press F12 to get the console up. Except in Firefox, you need to install the Firebug addon first.)
Was This Post Helpful? 1
  • +
  • -

#3 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Re: Debugging?

Posted 23 August 2013 - 05:29 PM

Yes i think it is a path error I tried just uploading a .jpg file and testing it in chrome and it doesn't work but it works in safari- does this mean that it would work on both on a live server. Thats wierd...Thanks for the help by the way; hopefully there is an easy fix and this is the only instance.

I created the images in a trial version of photoshop and they actually corrupt when i try to open them but they still display in safari...
Was This Post Helpful? 0
  • +
  • -

#4 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Re: Debugging?

Posted 23 August 2013 - 05:44 PM

Am i allowed to post about 400 lines of code?
Was This Post Helpful? 0
  • +
  • -

#5 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Re: Debugging?

Posted 23 August 2013 - 05:50 PM

I just read that maybe its a color error? maybe some colors dont work in some browsers?

http://stackoverflow...efox-chrome-etc

I know its stackoverflow but i found it off google (sorry dream in code) :nottalkingtoyou:/>

I guess my question at this point is how do you get an image to work in chrome that works in safari

thanks

This post has been edited by jimbang: 23 August 2013 - 05:54 PM

Was This Post Helpful? 0
  • +
  • -

#6 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3710
  • View blog
  • Posts: 5,958
  • Joined: 08-June 10

Re: Debugging?

Posted 23 August 2013 - 10:17 PM

Can you show us the image you are trying to display, and the code responsible for showing it. Note that we don't need to see the entire code, only the parts responsible for showing the image.
Was This Post Helpful? 0
  • +
  • -

#7 jimbang  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 49
  • Joined: 28-October 12

Re: Debugging?

Posted 24 August 2013 - 05:44 PM

I think it was just a j query fix

try to use code that works cross platform before you test it and pull your hair out...

lesson learned

enjoy your saturday, rush hour 2 starts in 15 minutes on tbs
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1