Quick Question

B

BryanA

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
 
B

BryanA

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top