Mobile Landing go back no redirection - javascript

I'm trying to make a web page that redirects to a mobile land page. It works, but on the mobile land page I want to go to the main page without using redirection but, of course, each time I go to the main page, it redirects me to the mobile land page (of course, as the script runs...).
So my question is: how can I link the mobile land page to the main page without redirecting when I link to it?

You could add a parameter on the url to the main page on the mobile site eg:
Go to full site
Then on the main page check if the parameter exists before redirecting.
var mredirect = getParameterByName("mredirect");
if(!mredirect && isMobile){
//redirect to mobile site
}
getParameterByName : How can I get query string values in JavaScript?

Related

I have developed http://livexcellence.com site using react.js. The link will breack after we refresh the page

enter link description here
When I navigate to different to different pages after the initial load, the app works perfectly fine. But When I refresh the same URL or copy and paste the same URl the page fails to load.
The problem is when I copy the same URl and open in another page, or refresh the same URl, the link will not work?
example: http://livexcellence.com/readytomove will not work if you try to open the link directly. Although the above link is with the websiteitself
I am able to access the correct page on http://livexcellence.com/#readytomove. Since you are using react routing regardless of you hosting the page

Dynamic Website - load almost all of the page with out reload and change the url

I am developing a website and having trouble figuring out what I can use to accomplish this requirement.
I need a website where links in the document load the contents of page that was clicked.
I am thinking about using angular.js but how might a user get back to the back by entering it into the url.
Example of what I am looking for:
You are on www.example.com
You click the link to www.example.com/profile/1234.
The page doesn't reload but loads the contents of the new page.
The static element at the bottom of the page doesn't change the the rest of the page does.
The url has also changed and you have the history of being at www.example.com
You can also load the exact same page by pasting the url www.example.com/profile/1234, it also has the same bar at the bottom.
You could also say I need something similar to youtubes website. You click a link and it loads only some of the page. But if you re-enter the url you get all of the page.
Thanks.

Refresh takes the webpage to homepage instead of showing present search result again

I am making a webpage which fetches query results from database.
The problem is whenever I reload page in Chorme, it redirects the page back to the home page instead of loading the same page again albeit it is redirecting correctly in FireFox and Safari.
For Example:
If the search URl is : http://bug.xyz.com/#/?bug_package=Demo&ndays=0
When I reload/refresh the page in chrome it takes me back to http://bug.xyz.com/ but I want it to reload the present URL only.
Language used: JavaScript
P.S. The link is for example purpose only and it will not work as the website is on intranet only.
My only thought is, what is the /#/ bit for. It may be what's causing your problem.
Otherwise you'll need to post some code.

How do I refresh the sharing URL for the AddThis Facebook button?

I'm using AddThis to render group of social media icons in the header of each page of my web app.
This is a Single Page Application (SPA), built on Angular.
So whenever the user navigates to another page, there's not a full page reload, but the components on the page are reloaded.
The trouble is, all the AddThis configuration stays the same. So even when the social media buttons get refreshed, the same sharing URL is shown when the user clicks the Facebook sharing button.
How can I clear this and replace it with the current page URL on each page reload?
From mucking around in the Chrome Console, I discovered a global property, addthis_share, which seems to allow me to update the sharing URL.
So I used code like this to updated it on each page reload:
window['addthis_share'].url = window.location.href;
window['addthis_share'].title = window.document.title;
I've encapsulated all the reloading code into a function, addthis_reload.
I had the same problem, but I found out that you could simply call addthis.toolbox() when you want the links to update.

redirect the users to default page (no login) if user navigates to the page directly by typing the URL

I have an ASP.NET 3.5 intranet website which has a default page with a menu and when the user clicks on a menu item, I display the page for that menu item in an iframe embedded within the default page. but if the user types the URL of a page directly in the browser, then I would like to redirect him to the default page, because all the content pages do not have a menu. (Master Pages will solve this issue, but I can't use Master page here for a reason and don't want to go into those details). how to find out if user has arrived at the page directly by typing the URL or by clicking on the menu item, so that I can decide whether to redirect or not? Is this possible to find out? btw this is an intranet site and no login is required. thanks in advance.
put this in your frame (or frame master page):
<body onload="CheckTop()"></body>
<script type="text/javascript">
function CheckTop()
{
if (window == window.top) window.location = //topurl, pilot page
}
</script>
You should use MasterPages for your problem, beacuse iFrames are not a good technique.
But, you could try it with a litte JavaScript-Snippet in the content pages:
<script type="text/javascript">
if (top == self)
window.location = "/index.html";
</script>
You simply check, if the loaded page is identical to your iFrame. If this is true, then your iFrame is loaded directly.

Categories