HTML link opening wrong page - html

I’m new to HTML and web design. I’m trying to open a page called “register.html” in the same directory as the current page using a link wrapped around a button. However, everytime i click the button, a page I am not requesting, called “registered.html” is trying to be accessed instead and the console throws an error as shown below.
Can someone please explain why a different link is trying to be opened instead of the one I’m asking the button to open? Thank you.
Code excerpt:
<form method = "get" action = "registered.html">
<button type = "submit" class = "registerAsButton1">Customer</button>
<button type = "submit" class = "registerAsButton2">Vendor</button>
ALREADY HAVE AN ACCOUNT? SIGN IN
</form>
Console error:
Not allowed to load local resource: file:///Users/betramlalusha/Desktop/vendor's%20Corner/registered.html?

first of all be sure that you are using the latest version of browser. Then be sure if your files are in the html css folder which folder you are using for edit. if it isnt stopped I would suggest you to reset your ide or reinstall your ide for the better experience other wise it should be opened. Thank you.

Related

How to show File Saveas Dialog in Blazor Server App

I am new to Blazor and trying to show File Saveas Dialog as shown in following link on a button click.
Save as Image
The requirement is - upon clicking the Saveas button above Saveas dialog should be popped up where user can choose the destination of file and file name.
I have tried "enabling the setting to check the save location in the download settings of the browser" and it works. But we do not want to depend on the Browser settings.
Please add your thoughts on below..
Instead of depending on the browser settings is there any other way to show Saveas dialog?
Are there any open source Nuget packages available to help on this?
NOTE: I am using .NET 6.0 for building my application
Thanks in advance,
Bhargavi Gowri.
I also wanted to bring up a window to save a file in which the user could select a folder. Before that, the system automatically saved to the Downloads folder.
As I understood, there was no such possibility before, but now it is possible thanks to this api: https://caniuse.com/native-filesystem-api.
I found this solution in the answer to this question: https://stackoverflow.com/a/70001920/16740180.
It's worth noting that I use Blazor WebAssembly and not a Blazor Server. And I do not know if it will work for you.
Unfortunately, this doesn't work for mobile devices right now, but it works fine for windows. I hope this helps someone.
This isn't a Blazor thing. In web browsers, files are downloaded from links using <a> tag in HTML using the download attribute. Just create a link to your file:
<a href="path_to_file" download>Save</a>
Save
The path must be on the same server, but blob and data links will work as well.
If you do not suggest a name, the browser will use the original filename (possibly changed to remove symbols the OS doesn't allow in file paths).
https://caniuse.com/download
If you want your link to look like a button, then that's a different issue, and you can google or ask that.

Open html file in a new tab instead of downloading it

For my Trac plugin, I have made an export script which converts contents to a different format. The result is an HTML code.
When I click the link, some browsers open the HTML code in a new tab, while others offer to download it as a .print file, depending on their specific settings I think. Opening this .print file shows the same HTML page as opening it directly, but locally instead of from the server.
How can I force it to always open in a new tab?
I think it might be a mimetype issue. If it is, which mimetype can I use to tell the browser to open the HTML code directly? I am currently using text/html as mimetype.
EDIT: some more info
To give some more insight, adapting from a comment of mine below:
I do not create the link myself. The link is provided by Trac, the bug tracking software the plugin is for, and what I do is implement the method that creates the HTML code and let it return the HTML code along with the mimetype. Trac then returns the HTML code either as a file, or as a new tab, when clicking on that content conversion link. What I am searching for is a possibility to specify in the HTML code or mimetype that it gets opened in a new tab directly.
Maybe there is some kind of mimetype specifying the (HTML) text as an HTML web document instead of HTML file (if that distinction even exists).
Or an HTML/XML header or doctype specifying whether it gets downloaded or opened by a browser. I think the browser need to get that information from somewhere.
Or maybe there is an option to set in Trac.
I hope these ideas of mine about what could exist can help those of you who are versed with either or some of these to find a solution. I could not find a solution through my research yet.
If you have a link that "directly" opens (not in a new tab) and you want it to open a new tab, one way of doing it is
This will create a blank page, then paste the link there automagically and thus you will have a new tab with the desired page.

Foswiki registration redirect - no page loaded

I have a foswiki site with user registration. It uses the standard registration form wherein users click a "register" button after filling the form. It redirects to: http://localhost/foswiki/bin/register/Main/WebHome and sits (no page loads and no error is shown). The source code shows this is correct, that is the button should post to this URL. I'm not sure why it isn't redirecting to the homepage. The user entry is created correctly and I can manually change the URL to: http://localhost/foswiki/bin/view/Main/WebHome and have it work.
I cannot find why it redirects to /bin/register... rather than /bin/view.... I thought it should be in the http config file, but I couldn't find it.
I compared the results in the console with those from registering on the foswiki website, but cannot see a difference.
I was able to get an answer on the IRC. It is an issue with the quickmenu skin. I stopped using the skin and the issue was corrected.

LinkedIn Member Profile Plugin

I'm attempting to use LinkedIn's Membership Profile Plugin found here:
http://developer.linkedin.com/plugins/member-profile-plugin-generator
However, every time I paste the code generated into my HTML document, nothing seems so show up. Forgive my ignorance if I'm missing something, I'm fairly new to HTML and CSS. After doing some searching I've seen a lot of talk about their API. Do I need an API key to get this to work? Or am I just missing something in my code?
Here is an example of the code I'm attempting to use:
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/MemberProfile" data-id="(Profile URL)" data-format="inline"></script>
Thanks for any help.
It definitely has to do with the fact that you are accessing it through file://C:\ ... \mypage.html instead of hosting it on a server like http://myserver.com/mypage.html.
You can see the error in Chrome if you press F12 for Developer Tools, under Console. It is hard to find the original reason, because all of it is run in those scripts.
But the scripts work, and you can see it running if you just paste it in somewhere like W3Schools TryIt page
Try with your "linkedin short url". For Example: "https://www.linkedin.com/in/xy":
You can customize your public profile URL when you edit your public profile. Custom public profile URLs are available on a first come, first served basis.
1.Move your cursor over Profile at the top of your homepage and select Edit Profile.
2.Click the URL link under your profile photo. It will be an address like www.linkedin.com/in/yourname
3.Under the Your public profile URL section on the right, click the Edit icon next to your URL.
4.Type the last part of your new custom URL in the text box.
5.Click Save.

Integrating a Back button

I have this theme http://themes.two2twelve.com/site/fluidapp/light/ installed on my website running wordpress. I converted the template to a wordpress theme by following the steps here: http://thethemefoundry.com/blog/html-wordpress/ and its all working fine.
However, I have now been given the crazy task to integrate a "Back button" function in it.
What they want is to have some sort of Back button functionality (or the browser one) so when they open Team and they press Back - they go back to Home. The template is basically one-paged, you can see so in the source code.
One way I can see this happening is if I make every page a different .php file, upload them to my theme folder and then just hyperlink them. like www.yoursite.com/team.php
Another possible way (I think) would be to create a page.php template file and then post the pages using wordpress. Question: How do I tell wordpress to use page.php as the page template file?
Can you think of another way to integrate this functionality? Thanks a lot in advance.
If it always is going to return the user to the startpage you could just use the home_url(); function.
Back
If you got more advance structure and you want the button to just redirect the user back one page, you should use javascript.
Back
page.php is the default template for wordpress pages. So if no other is selected in admin, page.php will be used.
If you're using javascript to load the new content, you could use javascript pushState()and popState() to log the stuff to new url's, and it gets added to the browser history. Here's an example.