giannis196 0 Posted September 29, 2019 Report Share Posted September 29, 2019 Hi everyone, i am trying to make a ajax page that’s fully crawl-able from search engine so search engines can find it but i need to know how i can insert the search bar’s value in to a variable so i can process it and make a script that will load with ajax the content: Here is the script that i make but i don’t know how i can fill the hpage (h for hash) with search bat value window.addEventListener("hashchange", function(){ var page=$(this).attr("data-id"); var hpage= $("#content").load("content/"+page); }) how i can insert the search bar’s value to the hpage? Can someone tell me how to do that? Thanks!! I also use jQuery too! Just to give some explanations… The script works, when i click somewhere it will load the content of the file to the #content div but the search engines can’t find the site. I need to make something like php’s $_GET but with javascript or jQuery so a user can even copy paste the link to other user. Right now when i try to copy paste the link it will take me to the index page (home page) but with different link. Search engines will be confused or ignore it because it’s the same page. Even if they don’t ignore it, when a user clicks the link ex: OurBrandCompany/#/content/ourhistory it will take him/her to home page instead of the page that shows “our history”) so…it will have ex: localhost/#/content/Ourhistory to the search bar but the user will be in the index page (home page) That’s the why i need to know how i can load the search bar’s value to a variable so i can process it and make it work. Quote Link to post Share on other sites
justsomeguy 1,135 Posted September 30, 2019 Report Share Posted September 30, 2019 https://developer.mozilla.org/en-US/docs/Web/API/Window/location https://developer.mozilla.org/en-US/docs/Web/API/Location Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.