HMTL - How to create a button without forwarding to the link - html

I wanna have a button which I want to press and open HTML web page in background. I don't want to see the site of my link. The link that I have in my code opens a site and this site is just a trigger for an application. So what I want to have is to press the button, execute the link in the background and stay on my site with my buttons.
How can I do that?
Right now I use this code and with this code I will be forwarded to my link. I have always to go back to press the next button.
This is part of my code:
<form>
<input type="button" value="Start" onclick="window.location.href='http://START'" />
</form>

I understand your question as follows:
After clicking a button, you want to open a url, but you don't want the browser to refresh. The url should be opened in the background.
Since javascript is an option, you should look into doing 'Ajax' calls.

Related

Pressing "try it" button reloads the page

when I press a try it button at the bottom of my page, it reloads the page and deselects all checkboxes. THe main problem i have with this is that when i select a box and click total, the total will be displayed for a split second, before the page reloads back to a state of nothing being checked.
enter image description here
If you don't want to have the page reloaded, you can use event.preventDefault();. when you use the event prevent function, this function blocks reloading the page when clicking/pressing the "try it" button.
Check type of button in your code. If you want to submit form data then only add <input type="submit"> otherwise use <input type="button">
If checked and it is well, then It would be great to add your code here or screenshot of code.

Generate Amazon link for open side popup with pre-applied filters

Edit: Stackoverflow modify automatically the Amazon links when you click, so for see the popup, select, copy and paste the URLs in the browser.
On Amazon there is a link to open directly a side popup, like this:
https://www.amazon.com/dp/B07FKTZC4M/#aod (#aod open the popup)
where We can enter some filters. I tried different ways with no success to generate a link that open directly the site popup with new filter pre-applied.
So i need a link that open this page with "new filter" pre-applied:
I tried different solutions, but don't work, for example:
https://www.amazon.com/dp/B07FKTZC4M/ref=aod_f_new#aod
https://www.amazon.com/dp/B07FKTZC4M/ref=new#aod
https://www.amazon.com/dp/B07FKTZC4M/#aod_f_new=true
https://www.amazon.com/dp/B07FKTZC4M/ref=aod_f_new=true#aod
https://www.amazon.com/dp/B07FKTZC4M/ref=aod_f_new?ie=UTF8&f_new=true#aod
I see some informations on source page, maybe that help:
Question: Is there a way to create a link that open directly the side popup with new filter pre-applied? Maybe adding some parameters to the URL.
You can call a function in JavaScript with which you can change the z-index of the popup.
Something like this:
<button onclick="popup()" value="open popup">
Also make the popup. I am just making a rough one:
<div id="popup" style="z-index:1000; position: absolute;">Some code</div>
Remember to set the z-index at behind and the position. Then for JS i will make it simple in case you can't code JS
function popup(){
document.getElementById("popup").style.zIndex=-1;//basically changing the popup's z-index
}
This will just change the z-index of the popup which you must create yourself

Inspect where html pop is coming from

I have this annoying popup where it only displays the number 1. tried to search it manually in the system but there is too much others ones. is there a way where i could inspect a popup?
on your web page click on view page source by clicking on mouse right click or by ctrl+u with keyboard shortcode.
and then find:
alert(
and comment all alert box into your code.
Get id of that alert and search it manually. To get id, follow the image boxes or press CTRL+Shift+C and press ok. You will find function call in element section. go to the function and get your alert box.

browser back button causes an iframe to be navigated

I have a web-page and withing that page I am using an iFrame. this iFrame contains two buttons previous & next. On next button click I change the source of iFrame to lets say page2.html and on previous button click i change the source back to page1.html. Issue is when i click the browser back and forward buttons it causes the iFrame to navigate (depicting the functionality of those above buttons). How can I avoid this, that is on browser back button click previous page should be loaded (of browser's rather iframe's).
Thanks
I got the solution to the problem. I have to replace the url of the frame by window.location.replace(newurl).
in this case it doesn't add into browser history.

Make link using submit button

Can I link one page to another page using submit button?
It sends all the wrong signals to the user, but:
<form action="some-uri"><div><input type="submit"></div></form>
The problem with using a submit form is that the next page will think that it has to deal with a binary request, which you can't do if using an upload form.
So you are better using a image button (can make it look like a submit button) or using JavaScript...
Open in a new window:
onClick="window.open('page.html');"
Open in the same window:
onClick="document.location.href = ('page.html');"