introduction for a website - web

I want to know how to make introduction page which lasts couple seconds and then takes you to the home page of website. That is, when someone types my domain name I need a page to introduce to subject of my website.

This would be what you could use to redirect the site, change the content to the amount of seconds you want the viewer to stay on the page.
<meta http-equiv="refresh" content="0; url=http://whatever.org/">
Referenced from HERE

you can do this in 2 ways,
create a pop up and use javascript setTimeOut() for delay
make index page as your subject of the website and use setTimeOut() for delay and then reidrect to your home page.

You could also use javascript to redirect. This example redirects the page after 2 seconds:
<script type="text/javascript">
function foo()
{
window.location = "http://www.google.com/";
}
setTimeout(foo, 2000);
</script>

Related

How can I redirect to custom pages when a user click New/Edit/Display in a SharePoint list

We are replacing the forms for our lists with forms built with SPFx. Building and deploying the form is no issue. The problem is redirecting the form controls to this form (when a user opens an item or clicks new, etc...). Is there a recommended method of accomplishing this? I have been successful using two methods but they both seem volatile and hacky.
The first being replacing the entire form code using SharePoint designer. For instance, the new form code would be
<%# Page language="C#" %>
<html lang="en">
<head>
<script type="text/javascript">
const list = window.location.href;
const site = list.substring(0,list.toLowerCase().indexOf('/lists/'));
window.location.replace(site + "/SitePages/MyListForm.aspx");
</script>
</head>
<body>
</body>
</html>
This works sometimes... Upon saving, the form code seems to regenerate the form code but the redirect still works. However, if I open and save the code again, everything breaks and the list action goes back to default (clicking new would now show the 'New Item' call out instead of directing to the form).
The other method is opening the new/edit/display form in the browser, with ?toolpaneview=2 which allows me to add a script web part to the page (although it doesnt like to save) and add the script redirect in.
<script type="text/javascript">
const list = window.location.href;
const site = list.substring(0,list.toLowerCase().indexOf('/lists/'));
window.location.replace(site + "/SitePages/MyListForm.aspx");
</script>
this seems to be less volatile than the first method, but it still seems hacky. If I delete the original form web part, the form breaks and the list actions again revert to default. Editing the script requires visiting the form with ?contents=1 to delete the script web part and then I have to re-add it again using the toolpaneview method. In order to even save the web part change I have to click "Edit Web Part", which in turn saves it. There is no simple "Save" action which again makes me feel like this method is not intended to be done.
Is there any recommended way to accomplish these redirects? I've found plenty or tutorials online about setting up the list form, but nothing about this essential step.

Refreshing websites and temporary connection loss

I want to display a refeshing external Website continously on a monitor.
The Website already contains an internal refresh (let's say every 30 seconds).
The Problem that appears right now is that in case of any connection loss the website tries to reload himself but will end up in a "connection has timed out state" and will no longer refresh. (because it's locked out).
What is the simplest way to avoid this "deadlock"?
I've already thought about having a Local Webpage that refreshs after a certain time, but this would cause a double refresh because the Webpage itself already refreshes every "n seconds".
Try the following:
<!doctype html>
<head><title>Insert Title Here</title></head>
<body style="margin:0;padding:0;width:100%;height:100%;">
<iframe style="margin:0;padding:0;border:0;width:100%;height:100%;" src="http://www.example.com"></iframe>
<script>
var iframe = document.getElementsByTagName('iframe')[0];
setInterval(function(){
iframe.src = iframe.src;
}, 5000);
</script>
</body>
Set the 5000 to n-1 seconds in milliseconds. (e.g., if n=30, use 29000)
Fiddle: http://jsfiddle.net/WdbNN/

redirect after 5 seconds using multithreading in asp.net mvc 5

I have a view without button and i want to redirect after 5 seconds to index view. I want to use multi threading timer or jquery.
I try search in google but i didn't found what that i want.
I try use:
http://www.aspdotnet-suresh.com/2012/10/jquery-redirect-to-another-page-after-5.html?m=1
this link but didn't work
How to make it?
thanks
You need to use the javascript function setTimeout()
The idea is that once you display the view, you call setTimeout() to do a redirect in 5 seconds.
<script type="text/javascript">
setTimeout ( function(){
window.location.href = "http://YourServer/Controller/Action";},
5000 );
</script>

Liferay page to auto-refresh?

We would like, for example, to have a page that displays a blog to refresh from time to time when a person leaves the page open.
Does anyone know of a quick and easy way to get a liferay page to auto-refresh at some interval? (preferably without having to create/modify a theme).
If you dont want to modify theme than just add new Web Contetn Display portlet to your page and create/select article that has only
<script type="text/JavaScript">
setTimeout("location.reload(true);",10000);
</script>
as content. Be sure to go to source view of your rich test editr field (if you use it).
Change 10000 (milliseconds) to your need.

Adding <meta> redirect using Greasemonkey

I'm looking to add <meta> element to specific websites using Greasemonkey script. The idea is to redirect the website to another page after X minutes. Something like below:
<META HTTP-EQUIV="Refresh" CONTENT="60; URL=http://example.com">
What is the simplest way to get this done?
You can use Greasemonkey (or JavaScript) to add the meta node, but it won't be parsed (at least in FF 4.0). AFAIK, browsers are only expected to parse meta directives on initial load.
You can use JavaScript to "redirect" the page, after an interval, like so:
setTimeout (function() {
window.location.href = "http://example.com";
},
60000 //-- 60 seconds
);
If you don't want the original page to remain in the browser's history, use:
setTimeout (function() {
window.location.replace ("http://example.com");
},
60000 //-- 60 seconds
);

Resources