• 0

How do I Direct Link to a Javascript Component?


Question

I run a photography / writing website called http://www.shutterscript.com. My photos are hosted off-site at smugmug (http://gallery.shutterscript.com). I have been working over the past few days to make my smugmug gallery and my main site look the same. In the process of discovering CSS (and its steep learning curve) I have run into a problem linking to certain components on my gallery page. The gallery uses javascript heavily and after considerable searching I have been unable to figure out how to link to one of their javascript components. All my search results turn up how to open one of my own links in a javascript window which is not what I am trying to do.

Here is what I want to do exactly:

The following link will take you to one of my photos:

http://gallery.shutterscript.com/gallery/3782986#218041532

If you click the "buy this photo" button directly above the photo it launches this cool javascript window by calling the following command:

java script:addCartSingle(ImageID);

Is there a way I can link directly to this javascript window with an href link?

Thanks in advance.

5 answers to this question

Recommended Posts

  • 0

IT's one sexy front-end when you click on the Buy link, isn't it! Beautiful.

Unfortunately though that window is entirely created using Javascript etc. on the page so it's by no means a trivial task to somehow navigate to a page and make it there. However it depends on exactly what you'll be using this for. If, for example, you just want to link to this Buy screen from another thumbnail on your site (outside the Gallery), and then have that load this page and automatically pop open the Buy window, that is something that IS possible.

Bit of clarification of why you want to do this, and I'm sure we can come up with a solution :)

  • 0

Rob, thanks for your reply. It definitely is a sexy front end.

Let me explain a bit further what I'm trying to do. On my main website, www.shutterscript.com I want to link to photos that are hosted on my gallery page (i.e. smugmug). Right now I do the following:

<a href="http://gallery.shutterscript.com/gallery/3781394#219133211-A-LB" title="Buy"><img src="http://gallery.shutterscript.com/photos/219133211-M.jpg" alt="Rights of Passage" ></a>

However, that only takes me to the photo page and not the shopping cart. I somehow want a user to be able to click on a thumbnail on my main site and then get redirected to the smugmug shopping cart for that photo. That would involve going to the link I noted above, then invoking this javascript function "java script:addCartSingle(ImageID);" with the appropriate image ID. I want to bypass the photo page and go directly to the shopping cart in order to reduce the number of steps users need to take in order to purchase a photo.

  • 0

Here's the source html from the photo page that calls the shopping cart:

<span class="title">buy:</span>

<div class="singleImageBuyLinks" style="display: inline">

<a href="java script:addCartSingle(ImageID);" class="nav"><span class="extraNav">this </span>photo</a>

<a href="java script:addCartSingle(ImageID);"><img src="/img/spacer.gif" alt="buy this photo" title="buy this photo" width="21" height="18" hspace="0" vspace="0" border="0" class="cart_add" /></a>

I somehow need to add a link that takes me to the hyperlink (http://gallery.shutterscript.com/gallery/3781394#219133211-A-LB) first, then does the above:

  • 0

I'm assuming this isn't possible, would violate cross site scripting stuff.

What i'm assuming is you want to be able to link to a page, then run commands on that page, if so that isn't possible (uless the page you're linking to is on your site, same domain)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Microsoft PC Manager 3.17.4.0 (Offline Installer) by Razvan Serea With Microsoft PC Manager, users can easily perform basic computer maintenance and enhance the speed of their devices with just one click. This app offers a range of features, including disk cleanup, startup app management, virus scanning, Windows Update checks, process monitoring, and storage management. Microsoft PC Manager key features: Storage Manager- easily uninstall infrequently used apps, manage large files, perform a cleanup, and set up Storage Sense to automatically clear temporary files. Health Checkup feature -scans for potential problems, viruses, and startup programs to turn off. It helps you identify unnecessary items to remove, optimizing your system's performance. Pop-up Management - block pop-up windows from appearing in apps. Windows Update - scans your system for any pending updates. Startup Apps - enable or disable startup apps on your PC, allowing you to optimize your system's startup performance. Browser Protection - rest assured that harmful programs cannot alter your default browser. Also enables you to change your default browser. Process Management - allows you to conveniently terminate any active process, ensuring optimal system performance and resource utilization. Anti-virus protection - Fully integrated with Windows Security. Safeguard your PC anytime. Quick Steps: Download Microsoft PC Manager Offline Installer (APPX/MSIX) with Adguard Adguard serves as a third-party online service, offering a user-friendly method for directly downloading appx, appxbundle, and msixbundle files from the Microsoft Store. Official download links will be generated for both the app's various versions and its dependency packages. How to download Microsoft PC Manager Offline Installer (APPX/MSIX) 1. Initially, you must find the app URL within the Microsoft Store. Access the Microsoft Store via your browser and search for "Microsoft PC Manager". Once located, copy the app URL, which includes the product ID, either from the address bar or from the provided link below. https://apps.microsoft.com/detail/9PM860492SZD 2. Now paste the app URL into the designated area, then click the check mark button to produce a direct download link. 3. To download, right-click the relevant link and select “Save link as…” from your browser's menu. Occasionally, Microsoft Edge may flag the download as insecure. In such cases, consider utilizing alternative browsers such as Google Chrome or Firefox to successfully complete the download. Microsoft PC Manager is a completely free tool optimized exclusively for use on Windows 10 (version 1809 or newer) and Windows 11. Download: Microsoft PC Manager 3.17.4.0 | from Microsoft Store View: Microsoft PC Manager Home Page Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • You might want to update to 1TB drive.  They are not very expensive these days, there are plenty of options - simple look I would think you could find a 1TB ssd or even nvme somewhere between 50 and 100 bucks. when I have moved to larger ssds in laptop in the past, you can just connect the drive via usb - image.  Then take the old drive out, put in the new drive and there you go..  If your concerned about how much space you have left this prob your best bet..   
    • I see! Wasn’t aware of that. Even though they started off with desktop app for Mac before Windows. Should be on it’s way soon! 🤞
    • support.microsoft.com/en-us/topic/microsoft-defender-update-for-windows-operating-system-installation-images-1c89630b-61ff-00a1-04e2-2d1f3865450d
    • It's a Developer Beta 1 not even a Public or User Beta, I doubt any of the design is 100% finalized yet.
  • Recent Achievements

    • First Post
      Johnny Mrkvička earned a badge
      First Post
    • Week One Done
      viraltui earned a badge
      Week One Done
    • One Month Later
      serfegyed earned a badge
      One Month Later
    • Dedicated
      firey earned a badge
      Dedicated
    • Dedicated
      fettermanj earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      627
    2. 2
      ATLien_0
      224
    3. 3
      Michael Scrip
      217
    4. 4
      Xenon
      149
    5. 5
      Steven P.
      139
  • Tell a friend

    Love Neowin? Tell a friend!