Load new page without clicking on an <a href> (using IUI)

15 views
Skip to first unread message

Zoltán

unread,
Dec 3, 2009, 12:42:25 PM12/3/09
to iPhoneWebDev
Hi!

I'm using iui.js, works fine, but I have a little problem.
Now my page contains links, the links are sliding fine, but I need a
better solution.

I want to use this instead of <a href>s:

<select id="biz" onChange="loadThisPage(this)">
<option value="sel.php?id=1">First</option>
<option value="sel.php?id=2">Second</option>
</select>

I have the value of the new page, I can alert() it :), I can put into
an <a> elements href, but I don't know how to tell to this iui
framework to slide it. :(

Please, help me!

Thanks,
Z.

Remi Grumeau

unread,
Dec 3, 2009, 12:45:54 PM12/3/09
to iphone...@googlegroups.com
Normally, if you put a onChange="window.location(this.value)" in the select, this should work

Remi

> --
>
> You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group.
> To post to this group, send email to iphone...@googlegroups.com.
> To unsubscribe from this group, send email to iphonewebdev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
>
>


Remi Grumeau
(+33) 663 687 206
http://www.remi-grumeau.com

Sean Gilligan

unread,
Dec 3, 2009, 4:11:25 PM12/3/09
to iphone...@googlegroups.com
Try using iui.showPageByHref(this.value, null, "GET", false, null)

That should load your page fragment via ajax and then perform the slide.

-- Sean

Zoltán

unread,
Dec 5, 2009, 3:49:01 AM12/5/09
to iPhoneWebDev
Sean, thank you very much, it works! :)

Remi, your solution does not work, if I do that, the page won't slide,
but opens it outside the framework.

Thanks for the posts!

Z.

Remi Grumeau

unread,
Dec 7, 2009, 6:19:13 AM12/7/09
to iphone...@googlegroups.com
This could work also, just a target value to change i think.
btw, happy for you if it works :-)
url ?

Remi

Sean Gilligan

unread,
Dec 7, 2009, 11:30:09 AM12/7/09
to iphone...@googlegroups.com
Remi Grumeau wrote:
> This could work also, just a target value to change i think.
>

Changing window.location will only work if the desired page fragment has
already been loaded and can be referenced with an anchor. Although, in
this case, it would probably be better to call iui.showPageById(pageId)
because it will take effect immediately, whereas when you set the
location you have to wait up to 300ms for the interval timer to fire and
call checkOrientAndLocation().


-- Sean

Remi Grumeau

unread,
Dec 7, 2009, 11:41:51 AM12/7/09
to iphone...@googlegroups.com

Good to know, thanks for the explanation !

Remi

Reply all
Reply to author
Forward
Message has been deleted
0 new messages