Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional XMPP Programming with JavaScript and jQuery
This is the forum to discuss the Wrox book Professional XMPP Programming with JavaScript and jQuery by Jack Moffitt; ISBN: 978-0-470-54071-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XMPP Programming with JavaScript and jQuery section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 23rd, 2010, 03:13 AM
Authorized User
 
Join Date: Jun 2008
Location: Faridabad, Haryana, India.
Posts: 20
Thanks: 1
Thanked 0 Times in 0 Posts
Default ScreenSize in JScript

Hi All,

I am using javascript for get screen width and height, Following javascript function i am using:

function test() {
var path = window.location+"?width="+screen.width;
window.location.href(path);
}

On page load event i am using this function with check javascript is enabled or not on page Load Event:

protected void Page_Load(object sender, EventArgs e)
{
if (Session["JSChecked"] == null)
{
Session["JSChecked"] = "Checked";
string path = Request.Url + "?JScript=1";
Page.ClientScript.RegisterStartupScript(this.GetTy pe(), "redirect", "window.location.href='" + path + "';", true);
}
if (Request.QueryString["JScript"] == null)
{
Response.Write("JavaScript is desactivated.<br/>Plz Activate JavaScript");
}
else
if (Request.QueryString["JScript"] != null)
{
if (Request.QueryString["width"] == null)
{
Response.Write("JavaScript is activated.<br>Plz wait Loading...");
Page.ClientScript.RegisterStartupScript(this.GetTy pe(), "test", "test();", true);
Session["JScript"] = "Enabled";
}
else { Page.ClientScript.RegisterStartupScript(this.GetTy pe(), "test", "test();", true); }
}

if (Session["JScript"] != null)
{
Page.ClientScript.RegisterStartupScript(this.GetTy pe(), "test", "test();", true);

Response.Write(Request.QueryString["width"]);
}

Response.Write(Request.QueryString["width"]);


But this is reloading the page. All items are displayed and then they are reloading again.

What is the solution for this reloading the page or get screen size minimum amount of time on page load.

Thanks in advance
__________________

  #2 (permalink)  
Old December 5th, 2010, 08:01 PM
Wrox Author
Points: 702, Level: 10
Points: 702, Level: 10 Points: 702, Level: 10 Points: 702, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

I think you posted this to the wrong forum. It does not seem to be related to XMPP.

Quote:
Originally Posted by Jitender View Post
But this is reloading the page. All items are displayed and then they are reloading again.

What is the solution for this reloading the page or get screen size minimum amount of time on page load.
If you modify the window.location object, it will force the browser to load a new page.
The Following User Says Thank You to metajack For This Useful Post:
Jitender (December 7th, 2010)
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Screensize Mantis Pro JSP 0 February 12th, 2005 07:01 AM
JScript DumAss HTML Code Clinic 1 August 25th, 2004 02:46 AM
PLEASE HELP! ACTIVEX in JScript stalker Javascript 2 August 15th, 2003 05:04 PM
JScript Des67 Javascript 1 July 28th, 2003 05:05 AM



All times are GMT -4. The time now is 08:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.