The answer to this question may be simple, but due to my inability to phrase it very well, I’ve been having a hard time finding search results on what I’m looking for.
Here is my issue: my page operates by displaying plain HTML files (that is HTML files with little to no CSS styling) onto a "mother" page that has all the CSS styling to make everything look nice. For example: let’s say on https://mywebsite.com
I have the following code:
<a href="#pictures" onclick="changecontent(1); return false;">click for pictures</a>
and if (page == 1) $("#content").load("/pictures.html");
This works just fine. However, if I want to link people specifically to my pictures section on my page…how can I do that without linking the actual pictures.html
? I’ve changed return false
to return true
and while it changes my webpage’s URL after clicking the link to this:
https://mywebsite.com/#pictures
actually putting https://mywebsite.com/#pictures
into the URL bar just takes me to the default https://mywebsite.com
. So, how do I go about linking a page with changed content on it? Many thanks!
2
Answers
Here are some examples on various ways to load the page
add this to your page