• 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

    • It didn't take that long, with the extension disabled (Cookie AutoDelete), without even leaving the browser, back on Neowin, and I'm greeted by this pop-up! So it's worse than with the extension enabled! Because before, at least during the same session, I could come back without having to close this pop-up! I'm going to do with it as if nothing was happening, and simply close the window. 🤷🏽‍♂️
    • "Can" is fine. I want the ability for it to "not." Actually, I would prefer vice versa. But it has to be optional, otherwise companies wouldn't be too happy.
    • ChatGPT can now connect to Outlook, Teams, Gmail, Google Drive, and other services by Pradeep Viswanathan Apart from regular consumers, ChatGPT is also growing fast among business users. In fact, OpenAI now has 3 million paying (Enterprise, Team, and Edu) business users, up from 2 million in February. During a live stream today targeted toward business users, OpenAI announced that ChatGPT can now connect to more external services to pull in real-time context and provide more useful responses for users. The following are some of the external connectors available in ChatGPT Deep Research for Plus, Pro, Team, Enterprise, and Edu users: Microsoft Outlook Microsoft Teams Microsoft SharePoint Dropbox Box Google Drive Gmail Liner In addition to the above, IT admins in organizations can now build custom ChatGPT connectors using the popular Model Context Protocol (MCP). These custom connectors will allow organizations to make use of the data available inside their proprietary systems and other apps within ChatGPT, alongside pre-built connectors. Today, the ChatGPT team also announced a new feature called record mode for ChatGPT Team users on macOS. The record mode feature will allow users to capture meeting audio and get meeting transcriptions, meeting action items, summaries, etc. ChatGPT record mode will also be available to Plus, Pro, Enterprise, and Edu users in the future. Kevin Weil, Chief Product Officer at OpenAI, tweeted the following regarding today’s launch: While ChatGPT's new connectors and features mark significant progress, it faces a formidable challenge in the enterprise market against Microsoft 365 Copilot, which enjoys native integration within the Microsoft 365 ecosystem.
    • I decided to give this a try and, wow. I like it. One of the most customizable browsers I've ever used I think, and it even has the classic menu bar. That's one of the reasons I've stuck with Firefox for so long. Not sure if I'll make this my main browser yet but it's looking good so far.
    • No messaging app from a large commercial entity is really encrypted to a point they are actually unable to access your content. If you trust whatsapp and friends to do this either you are a fool.
  • Recent Achievements

    • Apprentice
      DarkShrunken went up a rank
      Apprentice
    • Dedicated
      CHUNWEI earned a badge
      Dedicated
    • Collaborator
      DarkShrunken earned a badge
      Collaborator
    • Rookie
      Pat-Garrett went up a rank
      Rookie
    • Week One Done
      Outdoor Saunaio earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      340
    2. 2
      snowy owl
      167
    3. 3
      +FloatingFatMan
      161
    4. 4
      ATLien_0
      160
    5. 5
      Xenon
      128
  • Tell a friend

    Love Neowin? Tell a friend!