View Full Version : Load external page issue

01-12-2012, 04:04 PM
Hi all,

I'm a bit newbie in scripting, but i'm trying to learn by myself :). Hope you can help me with this :thumbsup:

I have two main pages, called index.html and news.html. Both pages loads a third page called news_content.html, using AJAX function load.

This third page has a pagination script, but the pagination has to be different if the page has been loaded from index.html or news.html (for example, the max items per page has to be different). The pagination settings are defined inside news_content.html.

How can I know, from the content page, with one has loaded it? Or... its possible to pass values from the main pages into the content page, in order to change the pagination settings?

Thanks in advance! :):):)

01-13-2012, 04:06 PM
I don't know how the ajax load works, but generally the way to do this is with query strings - at the end of the url you use to open your page you add a question mark and then something unique, so coming from index it would be like:


and coming from news it would be:


both will open the same page (the browser ignores everything after the question mark) and then you can use document.location.search to chop off what came after the question mark and turn it into a variable that tells news_content what to do.

google query strings for more info, or post some code/a link if you are having trouble.

01-17-2012, 01:13 AM
xelawho thanks for your time! I've tried your suggestion and works! :thumbsup::thumbsup::thumbsup: