Quick Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BryanA

    Quick Question

    I am new to JS and after googling for a little while I couldn't find
    an answer to my question. I have an ajax JS that auto updates a
    certain element. The problem is it has to request another page for
    each individual page that it sits on. I have a php get in there but
    because this site is in full js, every time I pass a variable through
    the url it starts back at the base page. The javascript sits at the
    top of the page and then loads in other pages and acts as a template.
    How should I go passing the current page url into the JS? I was
    thinking about using a variable in the element that it refreshes but
    am unsure of how to do that.

    Any suggestions?

    Thanks,
    Bryan A
  • BryanA

    #2
    Re: Quick Question

    On Nov 2, 8:29 am, BryanA <Bryan.Andr...@ gmail.comwrote:
    I am new to JS and after googling for a little while I couldn't find
    an answer to my question. I have an ajax JS that auto updates a
    certain element. The problem is it has to request another page for
    each individual page that it sits on. I have a php get in there but
    because this site is in full js, every time I pass a variable through
    the url it starts back at the base page. The javascript sits at the
    top of the page and then loads in other pages and acts as a template.
    How should I go passing the current page url into the JS? I was
    thinking about using a variable in the element that it refreshes but
    am unsure of how to do that.
    >
    Any suggestions?
    >
    Thanks,
    Bryan A
    To further explain, the url format is: http://www.example.com/index.php#page
    which turns into http://www.example.com/#page

    Because the #page is just the id of the page and the js file is
    sitting at the top of the page it can't be edited with url parameters
    which is what I need?

    Any Help is much appreciated!

    -Bryan

    Comment

    Working...