1

I have a button on an affiliate site that I'd like to add to my personal site. On the affiliate site that visitor would have multiple choices of products, and I want to focus directly on only one product.

Here is my button:

<button aria-disabled="false"
        role="button"
        id="fsDataGrid:1:addPack2Cartfs" 
        name="fsDataGrid:1:addPack2Cartfs"
        class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only joinAddToCart add-to-cart button right" 
        onclick="PrimeFaces.ab({s:&quot;fsDataGrid:1:addPack2Cartfs&quot;,u:&quot;submenu miaccountMenu cartBtn cartItems contentTitleForm mainForm&quot;});return false;" 
        type="submit">

        <span class="ui-button-text ui-c">Add to Cart</span>
</button>

When the visitor clicks on the button it loads the product into the cart. The URL of the cart only contains /myaffiliateid/language/checkout/join (/14dayreset/en/checkout/join).

So on my site, I'd like to have a single button that will load the above product directly into the cart with my affiliate ID.

I hope I'm making sense, as I've never really seen a button code like this before.

Any help would be appreciated.

Kindest Regards Pattie

Tiny
  • 27,221
  • 105
  • 339
  • 599

1 Answers1

1

Unfortunately, due to the stateful nature of JSF, this is not possible without having a XSS hole on the JSF website, which is very unlikely to find.

Your best bet is contacting the site's admin and asking if there isn't a public webservice API available for the particular purpose you had in mind.


As to the technical question, that JavaScript basically turns the HTML button into an ajax button. The parameters are basically client ID identifiers which the JSF developer had specified in process and update attributes of <p:commandButton> in server side identifying the pieces in HTML DOM tree which should be processed in the associated JSF component tree in the server side and updated in the client side once the ajax request returns.

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555