Dynamic web object url

Hi,
I am trying to set the url of the web object dynamically. If a user selects option A then in the web object loads url:http://abc.com/A.php and if option B is selected then the web object loads url:http://abc.com/B.php.

I have tried prez.object(“web_object”).http and .navigator also .location. None of these are in the manual or documented. Need a solution for this please.

Ali

Hi Ali!
I have 2 ways and hope it can help your problem.

  1. I create 2 objects(A and B) and 2 web objects( web A and web B), then I use On Click event and Show/Hide Objects action.

2… I create 2 objects(A and B) , then I use On Click event and Open Webpage action.

Project: web_objects.approj (736 KB)

Hi Li,

Thanks for the response. I will try your approach. The key thing is that the link is created with a random set of characters. So it will be something like http://abc.com/a.php?port=4234 and the next time it can be http://abc.com/a.php?port=4874

The port is randomly generated by a script.

Can the open page url be set dynamically do you think?

Ok so based on the help from Li, I have seen that we can assign a URL to a variable and select that variable with Open Webpage. So this definitely helps. Thanks Li.

The next question is if we can open that web page inside the current slide within the webobject. I created a webobject called wo5 and in Open Webpage I selected open in Named Page which was set to wo5…did not work. Any help from anyone will be appreciated.

Ali

Hi Ali!
I’m sorry for not helping your question about dynamic URLs.
For your next question, the web page which was set in Open Webpage action, it will show up in new tab or replace current tab of browser and it cannot display inside the current slide.
I think, there is no way to solve this question for you and I’m sorry about that.
Thanks!

Hi @ARaza,

You can use the following script to set the url for the web object:

prez.object('Web Object Name').frameNode.src = 'http://the/url';

Regards

Thanks for your help Li

OMG…it works…Thanks a MILLION Toan