Linking from one webpage to a specific section on another webpage - html

I have two webpages, one is index.html and the other is shop.html.
I am trying to link from shop.html to a section with the Id of #contact in index.html. They both share the same navbar. They are both in the same folder called "Mobile".
This is the code that I am using.
This is the code for the contact link that is on the navbar shared by both pages, but I am trying to accesss it from the shop.html.
<li>CONTACT</li>
I have managed to get it to work once, but that was only by right clicking and opening the tab in a new window.

I'm not sure if this works, but you can try:
Contact
This will force it upon opening it in a new tab. However, it should be working only doing
Contact

Try this:
<li>CONTACT</li>
By default, your browser should have target="_blank" as shown in the Firefox documentation. It may just be an issue with having your list tags wrapped around the anchor tag. If you post the CSS and HTML you are linking to in index.html, I can make sure this works.

Thanks for the help, turns out it was a jquery smooth scrool animation messing with it.

Related

Unable to switch properly between webpages

While I'm trying to switch between different sections of my webpage I am getting the following page as shown in the image. How can I solve this?
you need to provide context for your question for people being able to help you. I imagine you are trying to navigate between different html files, by clicking into an anchor tag, is that correct?
Go to next page
So in that case, you might be adding a wrong relative route, otherwise I think you should add more context to your question.
If you are trying to switch between sections on your webpage. Try adding section and giving them id. Then from any anchor tag you can reach the section by adding the following code.
Section 1
you can use jquery
$(".div").load("index.php .yoursection");
To switch between sections on your webpage,Use the id selector ,
Example:
<p id="opening">Hyperlinks are utilized by a web browser to move from one page to another...</p>
Now add the anchor tag to link,
Opening
"Opening" will be displayed as a link on the webpage. On clicking it, you will be switched on the same webpage where the id is "Opening".
In this example it is the paragraph tag.
If you trying to switch into another webpage,
Go to home page

Why my anchor link from a secoundary page is not working?

I have the following problem with one of my current projects.
I would like to achieve that when you click on a link which is on a secondarly page, it sends you to the home page but, not at the top of the homepage (by default), I would like that it sends you where a specific ID is.
At the moment I have the following URL in this special link but it doesn't work
link
I have tried different ways I saw in this community but I didn't have luck. At the moment when you click it send you to the homepage but at the top and my ID is almost at the end of the page
How can I fix it please?
Thanks
Kindly use below code on page load. make sure you call this once DOM is loaded. This will scroll the page to this anchor.
location.hash = "#contact-anchor";

Identical anchor ids on two pages: How to link from one page to the anchor on the other page

I have two websites page1 and page2. On every page there is a download form which I can access through the anchor id #DownloadForm.
On page1 I'd like to create a link to the download form on page2. I thought this would work:
But when clicking on this link (in Chrome) it takes me to the download form on page1. As if the anchor expression was evaluated first and then the rest of the href is ignored.
Btw: I'm using Wordpress but I guess that's not relevant here.
If anyone has a hint for me, I'd highly appreciate!
Have you tried the full page uri? I tried this and it worked for me in chrome and firefox.

Why is my jQueryMobile CSS Style being applied to a linked page?

I am using a jQuery CSS style on the main portion of my website. It works fine. Now, I also have a sub-directory of my website which should not use the style. When I manually navigate my browser to the sub-directory of the website, no style is applied which is what I want. When I click on a link to the sub-directory from the main area, however, it is applying the CSS style from the main part even though I am not referencing this CSS anywhere in the HTML of that sub-directory. If I refresh the browser, the style goes away.
Please can someone help me understand what is going on here? Thank you.
You are using jquery mobile, which by default loads the content of links via ajax. That means you don't have a page refresh when clicking on a link. The contents get dynamically inserted in your document which still has all your css.
More information here.
http://jquerymobile.com/demos/1.2.0/docs/pages/page-links.html
You have to disable ajax for that link. More information here.
jquery-mobile - how can I bind disable ajax links to a certain class
Clear your history and browser data, then refresh and try.
Try to open the link in chrome and using the developer options (F12)
look for the resources it is referencing. If the page is referencing
the CSS files then either Javascript is making the referencing or
you have accidentally kept the resource link. Let the forum know your findings.
Edit
Somebody seems to have done what I have mentioned and has come to conclusions that they are because of AJAX. The steps I have mentioned above would let you do that all by yourself.

I can not access some html code of a page

I’m trying to make web scraping in a web page, but there is code that I can’t reach. The part of the code of the page that I cannot achieve is accessed through an anchor tag. In the html is:
<a class="MTLink" href="#d192633539-47" title="example" >
But when I click on "#d192633539-47" does not appear what is intended, ie not appear that appears when I click on the link on the page. Instead appears another page.
Related to this I have also
<li id="d192633539-47" class="MainTabContent Hidden" tnIndex="192633539">
Someone can help me? What could be happening?
This element is controlled by JavaScript. Without tracing the JS code you cannot determine the intention of the click event.
There might be a problem with wrong cookie handling. Check it out.