-1

I need to link to an external page that contains a list of order numbers. The orders on this external page are loaded via AJAX when an order number has been clicked.

The external URL is like http://www.example.com/orders. The Javascript on the external page is: javascript:load_order('XYZ'). As the order is then loaded via AJAX. There is no url change to call that order directly.

How can I call the order (AJAX loaded trough JS) directly? I have no access to the external page.

I tried the following:

echo '<a target="_blank" href=https://www.example.com/orders/javascript:load_order('$ordernr[0]')'>'.$tracking_box.'</a>'; 

enter image description here

GTO
  • 135
  • 1
  • 2
  • 10
  • If you don't have access to the external page, there's probably no way you can do it. – Brian Glaz Jan 19 '18 at 14:47
  • @BrianGlaz: Thank you for your answer. I mean i can access the page, but i can not edit any of it's code. Is it not possible to trigger that javascript with something like : onPageLoad or so? Scuse me, i'm not a js expert at all. – GTO Jan 19 '18 at 15:14
  • the onPageLoad would have to be on the new page that you can't edit. – Brian Glaz Jan 19 '18 at 15:26

1 Answers1

0

I would have posted this as comment. But I dont have enough reputation to do that. Sorry for that.

Anyway, You probably can look into iframe. Load that external page via iframe in your own page. And do some stuffs.

  • Thank you @kishor Malakar. But if i load the page into my own iframe, would i then be able to execute that js and receive the order details page? – GTO Jan 19 '18 at 16:44
  • https://stackoverflow.com/questions/251420/invoking-javascript-code-in-an-iframe-from-the-parent-page I think this should answer your doubts. Also, if you have found my answer helpful, kindly mark it answered. It helps people with similar doubts reach the answer easily and it helps me too. – Kishor Malakar Jan 19 '18 at 16:54