Buttons not working with localhost/xxxxx.html - html

I have written a code for my html website project. When I open the html file itself, it loads correctly on various browsers. However, when I try to access the same file via localhost/xxxxx.html, the buttons don't seem to work. Other images and links work fine. All the files are placed within the same folder.
I have used a href along with the button element.
Can someone please help me? The project is due tomorrow and I am not a technology/coding native.
TIA!

The button element will not redirect you to the link you want because that's not what it is built for.
As you said, your link works fine, so you can use your link to navigate.
If you still want to use the button element, you can wrap it with the <form action="the_link_you_want_to_navigate" method="GET">. You can also use JavaScript code with a click event listener too.
But I think the best way to do this is by using the <a> tag and make it looks like a button using CSS properties.

Without seeing all your code it's tough to know why it's not working in your localhost. But... within the <button> element it's not typical to add an href the same way you would with an <a>. You can do it but with an onclick event in javascript.
I would suggest doing an Text and styling the .button class in your css.
Hopefully this helps and good luck on your project.

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

Mozilla cannot read my button with "href"

I created my portfolio but unfortunately I cannot use
a button properly. What did I wrong?
On Chrome it does work pretty well!
friendly regard
<button>Check Portfolio</button>
The proper method to implement this is to stick the button inside of a form with method="get" and an action attribute with the site you are linking to.
You can also use JavaScript to set an event handler on the click event of the button.
Also, you can use CSS to make an anchor tag look like a button.
The one route NOT to go is wrapping a button in an a or vice-versa. It's not proper HTML.
if you use an A tag, you stick the button inside it also, you should use the full url, unless its in the current directory the webpage is in. For example:
<button> Click Here to Google! </button>

Why does Chrome show nothing but div tags when I view the dom elements for an Ext JS app?

I thought some of the Ext JS objects would translate directly into non-div html tags. Why is everything a <div> in element view when viewing my app in debug mode? I never see any <button>,<img>,<a> or any other usual html tag.
For clarification:
Here is for example how the textfield looks like. Inside of all divs, tables, etc. there is input component. Use a "magnifier" tool to fined precise a component that you are interested in.
What is actual the question or problem?
Actually all this divs are wrappers for positioning and styling. To see initial components go deeper in divs. Actually it's nothing to do with chrome. Moreover there is some error in console, it can also be the reason why component wasn't rendered completely.

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.