Read URL parameter(s) on page load


#1

I’ve tried googling and searching on this forum site how to read url param on page load and I can’t seem to find any clear sample or instructions how to do this.

Can someone help me please! Thanks in advanced.


Passing external user ID as variable in URL, into Axure and back out for varification
#2

By “read” do you mean take name/vale pairs from a URL and use them in Axure in some way? If so, can you explain what you’re trying to do?


#3

Yes, I’d like to read the name/value pairs. I’m asking this because we have different prototypes and I’d like to reference them as external links on some prototypes which I supply the necessary parameter values and when that external prototype loads, it should read the url parameter name/value pair.

Thanks a lot! Much appreciate your swift reply.


#4

OK, so prototype A might have a button that links to prototype B, which passes some value to prototype B so that it can use it. I assume that the value can change based on what has happened in prototype A (so, a total for example, or a variable indicating whether the user is logged in or out).

Are both of these prototypes Axure prototypes? In which case the short answer really is to combine them into one :slight_smile:

Otherwise, I don’t think this can be done directly in Axure, but perhaps somebody more knowledgeable than me can suggest a way?


#5

You’re right!

Prototype 1 has a button that has OnClick interaction that opens an external link http://prototype2.axshare.com/#id=12345;p=Page_1?name=samplename

which should open Prototype2’s Page_1 and once Page_1 loads, it reads the url and extracts the name/value pair which in this case is

name = samplename


#6

I suppose if you could get Prototype 2’s Page_1’s OnPageLoad event to populate a widget in Prototype 2 with that URL in it, you could then parse out the necessary value from there and use it.

To do that, you’ll need to inject the relevant JavaScript function (perhaps window.location.href) into the prototype. A quick Google brings up this, but I’ve not tried it.


#7

Thanks JonB!

I’m still trying to figure this out. I will let you know once I figure this out or someone help us figure this out.

Again, thanks!