Results 1 to 3 of 3

Thread: Can two javascripts be combined

  1. #1
    Join Date
    Jan 2005
    Location
    SC
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can two javascripts be combined

    Hi,
    Not sure if this can be done or not, but here is what I would like to have happen.

    I've got two javascript functions that I need combined in one button. Here is the page I need it to happen on: http://knowledgebase.acstechnologies..._kb_admins.htm

    ----------------
    function emailSupport()
    {
    window.location="http://apps.acstechnologies.com/support/emailsupport/acsemailform.asp";
    }
    ----------------

    and

    ----------------
    var browserName=navigator.appName;
    if (browserName=="Netscape") {

    function closynoshowsme()
    {
    window.opener='X';
    window.open('','_parent','');
    window.close();}
    }
    else {
    if (browserName=="Microsoft Internet Explorer")
    {
    function closynoshowsme()
    {
    window.opener = "whocares";
    window.close();
    }
    }
    }
    ----------------

    What I want to have happen is once the user clicks Email Support, the window with the two buttons closes and a new window opens going to the Email Support Page. I'd also like to have it where when the user clicks Email Admins, that it opens a new email from their email client, then the small window closes.

    Can anyone help with this?

    Oh, I haven't posted in a very long time, so consider me a newbie.

    Thanks.

    ---
    Brandon
    Last edited by buzzy1; 05-01-2008 at 02:53 PM. Reason: misspellings

  2. #2
    Join Date
    Jan 2005
    Location
    SC
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Resolved

    I was able to figure it out. Feel free to check out the finished page at http://knowledgebase.acstechnologies.com.

    Scroll to the bottom and click Contact Knowledge Base Administrators.

    Thanks!

    -Brandon

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I will not vouch for the efficacy of your code or the wisdom of what you are trying to do.

    That said, just about anything can be combined in javascript, more so something as uncomplicated as these two bits of code:

    Code:
    var browserName=navigator.appName; 
    if (browserName=="Netscape") { 
    
    function closynoshowsme() 
    { 
    window.opener='X'; 
    window.open('','_parent',''); 
    window.close();} 
    } 
    else { 
    if (browserName=="Microsoft Internet Explorer") 
    { 
    function closynoshowsme() 
    { 
    window.opener = "whocares"; 
    window.close(); 
    } 
    } 
    }
    
    function emailSupport()
    {
    window.location="http://apps.acstechnologies.com/support/emailsupport/acsemailform.asp";
    closynoshowsme();
    }
    Note: As I say, I can't guarantee that it will work. They will only be as good together, as the two were separately to begin with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •