Stop HTML/JavaScript Page From Loading Mid Initialization

Dec 21, 2010

So imagine a piece of Javascript as the first script on a page along the lines of

var MySuperObject = new (function () {
this.SuperObjectInit();
})();

Now imagine that everything that proceeds this script (or a large portion therein) requires the SuperObject to have met its load conditions and loaded correctly.

Assuming for whatever reason the loading of the object fails I need to abort loading the rest of the page and the scripts in particular.

I know the majority of you are going to scream why not have your function issue a callback onSuccess and onFailed but the problem is this is in a ASP.Net project with masterpages, nestedmasterpages, usercontrols and so forth (each of which have their own dependencies and scripts); rendering such an approach problematic.

The other option (I assume) is to use window.location = "myErrorPage.html"; but I dont like the idea of having to create another page for an error message or the fact that it causes a redirect.

What I am hoping to do is something along the lines of

StopLoadingPage();
document.write("Error has occurred");

View 2 Replies


Similar Messages:

C# - How To Stop Loading A Page After The Request Is Sent

Jul 30, 2010

I have an ASP.NET (C#) page that has a long load time (like 2 minutes). The user is presented with a little animation and a "please wait" message. If the user accidentally loads this page, they need to wait for it to load.

My question is: Is there a way to stop the page load?

View 2 Replies

Stop The Rest Of A Page Loading Based On Some Parameters - Equivalent Of End / Response.End In Razor?

Feb 24, 2011

I'm trying to stop the rest of a page loading based on some parameters; but am not sure of the correct syntax.

@if(dayRes + dayTri == 2){<text>Sorry, etc</text> @Response.End}

The above throws this error: CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments

View 1 Replies

Web Forms :: Loading HTML Page Inside .aspx Page?

May 21, 2010

i have an html page and i want to open it in an .aspx.

I need to made some changes in html before i show that in browser , and i need to make them in memory, so i open and load and make changes to my html Page and , now i need to pass that html string to iframe, but i am not able to do dat from code behind, iframe.innerHtml do not work.

I tried to set innerhtml for a div instead of iframe, that works , but here when browser renders html page, it applies my Html page style sheat on my aspx ( where CSS are defined for body ). Means the CSS for body that is in head of my htmlPage , sets on my aspx page.

View 6 Replies

C# - Loading Complete Html-page In Contentpane Of Aspx-page?

Feb 7, 2011

I have different projects and libraries for which I've created helpfile with Sandcastle. Now Sandcastle provides also the possibility to create a website.

What I would like to do is to create an aspx-page where I can dynamically create a menu and where the existing helpfile-websites can be sollicited. All in one place.

Is it possible to accomplish this? Maybe some control that I can use to view an entire webpage?

View 2 Replies

Javascript - Redirect To Page With Loading Animation?

Aug 17, 2010

I already know this solution. (transfer the slow loading page to a loading-interim-page which shows the animation and then redirects to the actual page)But I would really like to solve this without a redirecting page.

View 2 Replies

Web Forms :: Stop Loading Files In App_themes?

Dec 8, 2010

All files in App_theme folder is loading when enter the URL I wanna stop loading files in App_theme folder ,How can I do this?

View 3 Replies

When The Page Is Loading, The Image Gets Really Big, Then Shrinks Down Being Called By The Javascript?

Feb 16, 2010

I have an image control that puts user's photo in it. Once it's loaded, I resize it using the javascript.But the thing is, when the page is loading, the image gets really big, then shrinks down being called by the javascript. Is there a way for me to pre-load the image before displaying it? I do'nt want to set the image control's width and height to fixed pixels at this point.

View 8 Replies

Deferred Loading Of Page Content Using Javascript Or JQuery?

Jan 14, 2011

I have seen few website where their home page is too big and when user scroll down to read the content the of the page then few area of that page load dynamically. how they design their page. as example the site is http://blog.rainbird.me/ where you can see the effect. please give me idea to achieve it via jquery & ajax.

View 3 Replies

Javascript - Display An Image While A Page Is Loading In An Iframe?

Nov 26, 2010

I have a website with a menu, when menu item is clicked I display the page for that menu in an iframe(iframe is set to display home page initially by default). sometimes it could take few seconds to display the page for the selected menu item (for example reports) and I would like to display a loading image while the page is loading. how to do this using javascript or jQuery

View 3 Replies

Measuring Page Loading When Javascript Enabled / Disabled

Nov 25, 2010

How do it exactly?

Measuring Page loading when javascript enabled / disabled

View 1 Replies

Javascript - Jquery Loading Values On Page After Post Back?

Oct 26, 2010

Im currently trying to use a jQuery plugin:jQuery Autocomplete TokenizerNow after posting back the page, I want to re-load the values back into the textbox for whatever items had been entered.Now the jQuery on the page is like below:

$(document).ready(function () {
$("#<%=txtPeople.ClientID %>").tokenInput("Handler.ashx", {
hintText: "Type in a name",
noResultsText: "No results",
searchingText: "Searching...",
[code]...

View 1 Replies

Javascript - Defer Loading UpdatePanel Content Until After The Page Renders?

Oct 7, 2010

Old hand at ASP.NET, new to the UpdatePanel. I have a reporting page which executes a fairly length SQL query... takes about 10 seconds right now. What I would like to do is have my page fully render, with some placeholder text (Loading...) and then have the UpdatePanel kick off the actual time-consuming reporting process and render the report when it's done.

So... my theory is to use RegisterStartupScript() to kick this off and drop the string from GetPostBackEventReference() to trigger the UpdatePanel update. Some problems crop up:

1) Can I actually use GetPostBackEventReference w/ the UpdatePanel or do I need to trigger it some other way? Use this method on a button inside the Update Panel?

2) What event gets triggered when the postback reference is the UpdatePanel? It's not clear to me. I've got to call my databinding code somewhere! Again, maybe I need to use a button inside?

View 3 Replies

Delay In Silverlight Initialization In Aspx Page?

Jul 23, 2010

We have a silverlight/asp.net application which communicates with WCF to fetch data. Now we are facing a problem where in the silverlight component is taking some time to initialize after the asp.net page life cycle is completed.We have tried tracing all the events and found that there is a time lapse between the aspx page unload event and silverlight initialize event. This we have tried with even a simple application (hello world) but still have found the same result.There is nearly 3-4 seconds delay i.e the silverlight component initialization starts 3-4 seconds after the page unload event ends.

View 1 Replies

Windows - .NET Web Page Loading - The First Page Loading Fails With HTTP 404 Error?

Jan 18, 2011

We have installed a web site written by others which is compiled with Visual Studio 2008 and hosted in Windows server 2008 R2.

The IIS connection timeout is set to 120 seconds. But for some pages, the first page loading fails with HTTP 404 error but sequential refresh can bring the page up. The same problem happens for some images which fail to load in web pages. We are not very sure it is network related issue or hosting issue.

View 1 Replies

How To Stop A JavaScript File From Downloading Twice In JavaScript

Jan 27, 2011

I have two user controls and both the user controls refer a same script path:

<script type="text/javascript" src="test.js"></script>

then what happens when the first user controls load then test.js will download in client and when second user control loads then test.js file will download again.

How do I check to see if the JavaScript file is already downloaded so it doesn't have to be downloaded again?

If I include the JavaScript file from the server side:

Page.ClientScript.RegisterClientScriptInclude("test",
Page.ClientScript.GetWebResourceUrl(this.GetType(),
"test.js"));

then how could I make sure it isn't included twice?

View 1 Replies

Javascript - How To Run Jquery Script If Html Page Is The Home Page

Sep 14, 2010

I'm working with an external team with our website and they recently added one of my scripts to the .NET MasterPage of the site... well it did finally get my script running but now... it loads Banners on 'every' page on the site.

How can I write an 'if' statement that basically says... if this is the home page... run this script... if not don't...?

View 4 Replies

Javascript - How To Embed A Static HTML Page In Aspx Page

Mar 7, 2011

I have a static HTML page complete with client-side scripts and css (both are included in the html). I was wondering if it would be possible to embed this HTML page into an ASPX page and have the ASPX page be able to respond to javascript events that are raised from within the static html document? Does asp.net provide a specific control for this or can I use a frame?

View 3 Replies

AJAX :: Display Light Box Loading Image On Page When Update Panel Is Loading

Mar 6, 2013

I have update panel on the page to avoid postback and placed a dropdownlist control within that update panel. DrodownList is filled with Category names and also it's autopostback set to True.

Now whenever dropdownlist index change's on select, untill page loads complete  data it should show mesage as "Loading.... in center and middle of the page and background should become bit transparent". And when page load completely with data then that background and message should get disappear.

View 1 Replies

Php - Get Page HTML At Client Side Or Javascript

Jan 14, 2010

how to get page HTML at client side or through javascript in Asp.net Application. Means if I want to get the html of http://www.yahoo.com on client side through javascript or any other

View 5 Replies

Javascript - Hide Html Page Source

Nov 16, 2010

Is there is any way to hide asp.net page view source?

View 4 Replies

Web Forms :: Embedded Javascript In Html Page - Get ID Of Control

Jan 17, 2011

With embedded Javascript in an html page, I would use the following to get the ID of a control.

[Code]....

View 4 Replies

Send Mail Through JavaScript In HTML Page Secretly?

Nov 2, 2010

I am using a mailTo command.

On posting it displays Outlook Express on my computer.

But I want to send secretly, data to my email form client end.

View 4 Replies

Want To Display A Loading Animation While Page Is Loading

Jun 23, 2010

I want to display a loading animation while my page is loading, and when loading is complete then obviously hide it.

I am working in ASP.NET using Masterpages, just wondering there is a a simple way of doing this using JQuery?

View 3 Replies

Possible To Stop Event Using JQuery/javascript?

Sep 9, 2010

I have some code like below in an aspx page:

[code]....

I had thought that returning false would keep my asp.net OnClick even from firing, but it still does. I've confirmed that it is getting to the return false section of code using alerts. Is there anything I can do to stop it from firing using jQuery/javascript?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved