Click here to Skip to main content
15,923,083 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

I have to check some condition on browser startup event means when I open the broser with some url like www.xyz.com at the same moment as I press enter before page load, I have to check some parameter how to get this using javascript or jquery.

Regards
Alok Singh
Posted
Updated 6-Jun-14 0:38am
v3
Comments
DamithSL 28-May-14 2:38am    
is this only for your web page or you want to do this for any web page?
Alok.singh1166 28-May-14 2:46am    
As we can understand user has logged on in one project he can save or bookmark any page in the browser or he has set the property in browser ( continue where i left) now browser is closed.Next time when user will open the browser that same page will load there i want some condition in java script to restrict him. I want my java script code to run first . How i will achieve this please help. :)
Alok.singh1166 28-May-14 3:17am    
Somebody please help me :(
Alok.singh1166 29-May-14 2:30am    
Please help me

Use Jquery

save your bookmark inside the following event. Then check the bookmark at login page and redirect to the saved bookmark page.

$( document ).ready()
A page can't be manipulated safely until the document is "ready." jQuery detects this state of readiness for you. Code included inside $( document ).ready() will only run once the page Document Object Model (DOM) is ready for JavaScript code to execute. Code included inside $( window ).load(function() { ... }) will run once the entire page (images or iframes), not just the DOM, is ready.

http://learn.jquery.com/using-jquery-core/document-ready/[$( document ).ready()]
 
Share this answer
 
Using C#

System.Web.HttpBrowserCapabilities browser = Request.Browser;
browser.Type.ToString()
browser.Browser.ToString()
browser.Version.ToString()
browser.MajorVersion.ToString()
browser.MinorVersion.ToString()
browser.Platform.ToString()
browser.Beta;
browser.Crawler;
etc....

Using Javascript:
Set MyBrow=Server.CreateObject("MSWC.BrowserType")
MyBrow.platform
MyBrow.browser
MyBrow.version
MyBrow.frames
etc...
 
Share this answer
 
Comments
Alok.singh1166 29-Sep-15 1:36am    
how this will work .where I need to write these code in order to achieve my tasks complete please help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900