Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7429691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:00:42+00:00 2026-05-29T09:00:42+00:00

I run an e-commerce website where the following function is defined. I don’t control

  • 0

I run an e-commerce website where the following function is defined. I don’t control the template where this function is called. It is used to open a small contact window. The URL changes from session to session. I need to somehow parse that URL out of the function and store in a variable to call it from fancybox using a plain HTML/CSS template that I control. Do you know how I could do this? Here is the function:

function OpenContactWindow() {
    window.open('/UI/ContactInfo.aspx?id=R6nq0s8aTFntDzsV-p-pXm22kKpENjtYjAsgwTtIa5Qhhf5CT4Ndx7Rg-e-e', '', 'fullscreen=no,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=800,height=600');
    return false;
}

On the template that I do control, I have a link where the function is called and it opens up in a plain pop up window:

<a href="javascript:void(OpenContactWindow());">Contact Us</a>

This is the code I came up with, but it does not work:

$(document).ready(function(){
$(".extLink").fancybox({
     'width' : '75%',
     'height' : '75%',
     'autoScale' : false,
     'transitionIn' : 'none',
     'transitionOut' : 'none',
     'type' : 'iframe'
 });

 }); 
});


<a class="extLink" href="javascript:void(OpenContactWindow());">Contact Us</a>

What is the code I should be using? I’m a newbie! =)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:00:43+00:00Added an answer on May 29, 2026 at 9:00 am

    I don’t know anything about FancyBox, but here’s a way to parse out the URL from the function:

    var contactURL=OpenContactWindow.toString();
    var contactURL=contactURL.split('window.open("')[1];
    var contactURL=contactURL.split('",')[0];
    //contactURL now contains the URL to the contact form
    

    Basically, you just convert the function to a string with .toString(), then use a couple of split()s to find the URL. You’ll notice that although the window.open() in the OpenContactWindow function uses single quotes, this uses double quotes. JavaScript automatically replaces the single quotes with the double quotes. As noted, the variable contactURL contains the URL from the OpenContactWindow function. You should be able to take it from there and use FancyBox however necessary.

    You can find a demo here. Just click the Get URL button, and it will show you the URL. Check out the source, and you will see that it does in fact check the function. The function uses a random string for the ID, which is generated by PHP each time the page is reloaded. After the button is clicked and the URL is shown, the page is reloaded so you can see it at work again, with a newly generated ID.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an asp.net application/plug-in to run on a asp.net website/e-commerce solution. I want
I run a small e-commerce site that over the last few years has built
I run an ASP.NET website solution with a few other projects in it. I've
I run into similar codes like this all the time in aspx pages: <asp:CheckBox
I run into this quite often where a new page is supposedly tested and
Run the following Java code: boolean b = false; Double d1 = 0d; Double
I run a D&D campaign made up of lots of small worlds, each touching
Background: I'm working on an e-commerce website. It was my original intention to add
I'm working through some touches on an e-commerce site for someone and have run
run the following, and its supposed to return the company name. The xpath works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.