Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Test Page work in IE but not Firefox

Posted on 2012-03-23
2
Medium Priority
?
340 Views
Last Modified: 2012-03-23
I built the attached test page.  I thought it was working, but when I tries it in Firefox not all of it functions.  The favoite buttons don't work.  Here is the page
http://www.glassdivider.com/Wedding_test.html

Here is the script:

<script type="text/javascript">
function LGpic(id){
      var picid = "pic"+[id];
      var txtid = "txt"+[id];
      var image =document.getElementById(picid).src;
      var text =document.getElementById(txtid).innerHTML;
document.getElementById('Largepic').src = image;
document.getElementById('txtLP').innerHTML = text;
}
function fav1(){
      var bigtxt = document.getElementById('txtLP').innerHTML;
      var bigpic = document.getElementById('Largepic').src;
      document.getElementById('Favorite_pic1').src = bigpic;
      document.getElementById('ftxt1').innerHTML = bigtxt;
}
function fav2(){
      var bigtxt = document.getElementById('txtLP').innerHTML;
      var bigpic = document.getElementById('Largepic').src;
      document.getElementById('Favorite_pic2').src = bigpic;
      document.getElementById('ftxt2').innerHTML = bigtxt;
}
function fav3(){
      var bigtxt = document.getElementById('txtLP').innerHTML;
      var bigpic = document.getElementById('Largepic').src;
      document.getElementById('Favorite_pic3').src = bigpic;
      document.getElementById('ftxt3').innerHTML = bigtxt;
}
function fav4(){
      var bigtxt = document.getElementById('txtLP').innerHTML;
      var bigpic = document.getElementById('Largepic').src;
      document.getElementById('Favorite_pic4').src = bigpic;
      document.getElementById('ftxt4').innerHTML = bigtxt;
}
</script>

Thanks for the help.
0
Comment
Question by:jws2bay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 2000 total points
ID: 37758785
please debug using FireBug...
Try to avoid document.getelementbyid and try using jquery for all DOM related activity.
Its tailor made for cross browser solutions....

here are the corrections to fav1:-

function fav1(){
      var bigtxt = document.getElementById('txtLP').innerHTML;
      var bigpic = document.getElementById('Largepic').src;
      document.getElementById('favorite_pic1').src = bigpic;
      document.getElementById('ftxt1').innerHTML = bigtxt;
}

marked bold is modified, letter f of favorite should be smaller.
Fire fox search is case sensitive..

Make the other changes accordingly...
but just try to use JQuery and be specific with case when you work in JS.
0
 

Author Closing Comment

by:jws2bay
ID: 37759403
Thanks for the help.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question