Solved

Test Page work in IE but not Firefox

Posted on 2012-03-23
2
323 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

737 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