SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Need help with

Hybrid View

  1. #1
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need Help with -- DialPad -- Script

    Hello,

    I hope someone can help me with this script.

    This is a script for "DialPad". When a user clicks on the "DialPad" button a popup window comes up which allows for one to register for their service or sigin.

    The code works on this page
    http://TestingDoneHere.Homestead.com/radiosonicnet.html

    Code:
    <TR>
    <TD>
    <script language="JavaScript" type="text/javascript"><!--
    function openDialpad()
    {
      var browserParsed = navigator.appVersion.substring (0,4);
      var browserName = navigator.appName; 
    
      if (browserName == "Netscape" && browserParsed < 4.06){
        alert("Netscape " + browserParsed + " is not supported");
        return false;
      }
      if (navigator.platform != "Win32") {
        alert(navigator.platform + " is not supported.")
        return false 
      }           
      if (!navigator.javaEnabled()) {
        alert("Java should be enabled to use Dialpad");
        return false;
      }
    
      window.open('http://www.dialpad.com/cgi-bin/launch.pl',
       'Dialpad', 'scrollbars=no,resizable=no,width=420,height=370');
      return false;
    }
    //-->
    </script>
    
    <a target = "_parent"  href="javascript:void(0)" onclick="openDialpad('')">
    <img src="http://testingdonehere.homestead.com/files/dialpad_launch.gif" alt="make free long distance calls"
    width="88" height="31" border="0"></a>
    </TD>
    <TR>
    The same code does not work on the following page,
    http://www.Calendars.net/cals/TestingDoneHere

    I cannot figure out what I am doing wrong here.

    Any and all suggestions appreciated.

    WP
    Webbing Along!!!

  2. #2
    SitePoint Member
    Join Date
    Sep 2000
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not able to see your code for the site that doesn't work, but one thing that does come to mind is the objects name. When build my Dynamic Sites, I have to make sure that none of the names are the same other wise when I make the call to the item, wether it is a form item or a layer, it will want to call the first one with that name.

    ie:

    <layer id="the"></layer>

    <input name="the">

    there would be an error if I called for the "the" object due to it being named in two places. That is just a thought, I will try to check your code again. And if you need to me explain more, please just ask.

  3. #3
    SitePoint Addict
    Join Date
    Oct 2000
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Proofread your code! One error I immediately noticed is that the openDialpad function is not defined -- because you've got a comment jammed against it:

    <!--function openDialpad(){ ... etc

    should be...

    <!--
    function openDialpad(){ ... etc.





  4. #4
    ********* Addict WP1's Avatar
    Join Date
    Aug 2000
    Location
    New York , USA
    Posts
    407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks "etLux" and "dndpavlik" for responding.

    I wrote to support at the Calendar service and received an answer indicating that javascript code placed by users did not work well on the Calendar and that I should just link to another location for a site visitor to access.

    I really did not want to do that.

    Sooooooooooooooooo. With my limited knowledge of Javascript I did the following. I removed all the code except for the one part of it left below,
    Code:
    <A HREF= "#" onClick="window.open('http://www.dialpad.com/cgi-bin/launch.pl','Dialpad','width=420,height=370,scrollbars=no,resizable=no');return false"><img src="http://TestingDoneHere.Homestead.com/files/dialpad_launch.gif" alt="make your calls here" width="88" height="31" border="0"></a>
    I have used this exact code in another calendar with no problems. This time, however, I substituted in Dialpad's information. I also removed the Dialpad script I made up and moved it from the header portion of the Calendar to the Title area. The script just would not work in the Header part of the Calendar. Actually all the script you see now is in the Title part of the Calendar. I have left the header part empty for now.

    Now the doggone thing works.

    Thanks again for your help.

    WP
    Webbing Along!!!

  5. #5
    SitePoint Addict
    Join Date
    Oct 2000
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Programmer's First Law: "If it works, it must be right."


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
  •