Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 5 of 5

This is a discussion on Problem with button not working in the Design and Development forum
I am converting a friends website from a frame based site to a frameless site. There are buttons on the available properties page that call ...

  1. #1
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161

    Problem with button not working

    I am converting a friends website from a frame based site to a frameless site. There are buttons on the available properties page that call a javascript function to show a google map of the location. I have all the javascript code the same as the old site but for some reason the button is not working on the new one. I know it's gotta be something real stupid. Maybe someone can take a fresh look at it for me... I've been looking at it for hours and I'm about ready to go crazy.

    The new site is:

    http://zimprops.com/?page=available

    The old page is:

    http://dev.zimprops.com/availprops2.php

    I moved the old site to my development subdomain just so I had something to go by. Any help would be great.

  2. #2
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Hrm...

    Taking a quick peek - shouldn't that first instance of mapbutton22 be wrapped in single quotes?

    EDIT

    First instance of mapbutton18 too.

    I see the beginning quote only...

    Code:
    function showMap22() { 
    alert('Got here!');if (document.getElementById('mapbutton22).value=='Show Map') {
    document.getElementById('mapbutton22').value='Hide Map';
    document.getElementById('map22').style.display = 'block';
    var map22 = new google.maps.Map2(document.getElementById('map22'));
    map22.setCenter(new google.maps.LatLng(40.3690599,-80.6234779), 15);
    var point = new GLatLng(40.3690599,-80.6234779);
    map22.addOverlay(new GMarker(point));
    map22.mapResize();
    } else {
    document.getElementById('mapbutton22').value='Show Map';
    document.getElementById('map22').style.display = 'none';
    }
    }
    function showMap18() { 
    alert('Got here!');if (document.getElementById('mapbutton18).value=='Show Map') {
    document.getElementById('mapbutton18').value='Hide Map';
    document.getElementById('map18').style.display = 'block';
    var map18 = new google.maps.Map2(document.getElementById('map18'));
    map18.setCenter(new google.maps.LatLng(40.3690457,-80.6245213), 15);
    var point = new GLatLng(40.3690457,-80.6245213);
    map18.addOverlay(new GMarker(point));
    map18.mapResize();
    } else {
    document.getElementById('mapbutton18').value='Show Map';
    document.getElementById('map18').style.display = 'none';
    }
    }
    </script>
    Put another way:

    Shouldn't...

    Code:
    alert('Got here!');if (document.getElementById('mapbuttonXX).value=='Show Map')
    ...actually be?

    Code:
    alert('Got here!');if (document.getElementById('mapbuttonXX').value=='Show Map')
    Last edited by Vin DSL; 06-30-2010 at 04:23 PM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  3. #3
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161
    Thanks that was it. Can't believe I missed that. All the Javascript is created dynamically by PHP depending on which rentals are available. That's why it was like that in both place.

    Thanks again for your help!!

    Randy

  4. #4
    eh?!
    Join Date
    Jan 2005
    Posts
    105
    In addition to what Vin DSL explained about the missing quote, I noticed that the two blocks of javascript are not exactly the same. Perhaps you could simply copy the block of code from the working file and see if it works in the new file? (never mind - I can see your recent post, and the problem is fixed)

    Comment about the images - the page would really benefit from having actual 50x50 thumbnails linked to larger images rather than just using:
    Code:
    width='50' height='50'
    The first time I visited your web pages they took a long time to load on a moderate speed DSL connection.

  5. #5
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161
    Good point Don. I've noticed that too and haven't addressed it yet. I'll probably use a php script to create the thumbnails on the fly.

    Randy

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •