?
Solved

Test Page work in IE but not Firefox

Posted on 2012-03-23
2
Medium Priority
?
331 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses

800 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