Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Load external page issue

    Hi all,

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

    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!

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,980
    Thanks
    56
    Thanked 557 Times in 554 Posts
    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:

    www.mysite.news_content.html?ind

    and coming from news it would be:

    www.mysite.news_content.html?news

    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.

  • Users who have thanked xelawho for this post:

    jarenare (01-17-2012)

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    xelawho thanks for your time! I've tried your suggestion and works!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •