sIFR 3 issue (IE) with BlockUI and UpdatePanel - updatepanel

I am experience an issue using sIFR 3, jQuery BlockUI and an UpdatePanel where the page refreshes and the SIFR font disappears.
In the Javascript file I use to handle the blocking and unblocking of the UI, I detect the partial postback and unblock the UI:
prm.add_endRequest(function() {
$.unblockUI(); });
If I re-run sIFR.replace() in this code block the font sIFR font is rendered, but # characters are replacing my page title (in the top of the browser window/tab). This seems to only happen in IE (go figure.) Each time I refresh the page using the LinkButton an extra # character is added, so my page title ends up looking like "#########". Any idea why this is happening?
Is there a specific sIFR.update() function I should be running instead? If I execute sIFR.redraw() or sIFR() I get javascript run time errors.

This is caused by a bug in IE:
This is a very peculiar bug in IE where for each Flash movie in the page the fragment identifier part of the URI (#foo) is repeated in the document title. It has been reported by Macromedia that this bug can be fixed by updating the VBScript engine the browser uses. However, for those users who still have the wrong engine sIFR contains a workaround.
http://wiki.novemberborn.net/sifr/Fragment+Identifier+Bug
sIFR 3 has a workaround but it doesn't kick in unless the page is loaded with a fragment identifier (window.location.hash != ""). In your case, I assume the page is loaded without the identifier, then you add one, and then you re-run replacements, reinvoking the bug.
You can patch r436 by opening (the compressed version of) sifr.js and replacing this.fix=c.ua.ieWin&&window.location.hash!="" by this.fix=c.ua.ieWin.

Related

How to edit the DIV which renders only runtime. which is not present in HTML page?

I have a small web app which has <a href="> tag which renders the only runtime I mean it does not appear in HTML page it appears only in chrome developers tools. How to eliminate such kind a tag and override or edit it.
I tried editing code via its script when I inspected for long it split document.querySelector("#m360CrA483349594983") but when I search entire project there's no sign of it!
demos written can be eliminated for sure!
Even I tried to Enable Local Overrides on but nothing seems to work that mysterious tag is kept coming saying
"demos written can be eliminated for sure!"
once the dom is ready you can access the element
<script>
(function() {
// the DOM will be available here
document.getElementById("m360CrA483349594983");
})();
</script>
Add body onload event listener in order to search for tag appearing at runtime.
Also, pay attention to tag ID value, it seems it is generated every time, so, you won't be able to find it by static ID

Does clicking a link always cause a full-page re-rendering?

Here's a scenario: Page1.html and page2.html are identical, except a change of a single word.
page1.html
<html><head></head><body>
Lorem ipsum *one*
...Stuff here...
click me
...Stuff here...
</body></html>
page2.html
<html><head></head><body>
Lorem ipsum *two*
...Stuff here...
click me
...Stuff here...
</body></html>
As you can see, everything is identical in both pages except that in page2.html, *one* is swapped with *two*
Now, assume a visitor visits page1.html, and clicks on the a href link, will the browser re-render the entire DOM or simply detect the changed word and modify it?
This is obviously implementation specific, my interest is an answer for the major browsers (Chrome, Firefox, Opera, Safari, IE...)
Yes it will, unless you change your link click to a javascript that loads an inner HMTL dinamically. This is called Ajax.
I will surely load the entire page...A href requests basically reload the complete page..you can still load part of the page using Asynchronous javascript and xml... AJAX :)
It will attempt to reload the page.
If you want to stop the default action of reloading the page you could use event.preventDefault();.
More info here: http://api.jquery.com/event.preventdefault/]1
#Rodrigogq sums it pretty much up.
I would recommend using jQuery for replacing text.
$('body').text(function () {
return $(this).text().replace("one", "two");
});​​​​​
This wouldn't use ajax but simply replace.
Can be modified to a button press.
If the URL is changed the browser loads the data from new address and needs to render it again – regardless of implementation of the browser. The difference between the HTML documents would be visible not earlier than when the new document would be loaded ant parsed into DOM which means that it gets rendered rather than finding the differences (which would be non-trivial task).
If you want to change only the content of particular element you need to use Javascript and set either static value or load it via AJAX.
To answer:
"As long as the bytes in the html page being downloaded match the bytes in the html page the user is currently seeing, do not re-render that part"
» Here is what it looks like in most browsers:
Step 1: Click on a link
Step 2: Get head response from the destination server (good if there is content-length included)
Step 3: If response is render-able (usually 200), Start unloading the already loaded DOM.
Step 4: Load the new content and render.
This prohibits any byte level comparison with the current and new request to identify the difference.

How to get arguments from LaunchApp NFC tag (when NavigationPage is not set in manifest)? WP8

Answer from this question works fine if you have NavigationPage set for your default task in WMAppManifest.xml (it's set by default).
Unfortunately in my current application the start page depends on whether a user is logged in in the application. I determine this and then manually navigate to a required page in Application_Launching. Because I do navigation to the start page myself I don't have ms_nfp_launchargs argument in a QueryString.
Is there any other way to get arguments from LaunchApp NFC tag?
Ok, there are several solutions to this.
One is to use a temporary start page and renavigate to the real one from there.
Another option is to write some code word (like "startPage") in NavigationPage in manifest, and then to catch this code word in a custom UriMapper on a RootFrame and navigate to the required page.

textarea fields: IE behaves differently when loaded through a partial refresh

I have a page in XPages that I use to open and edit a document. There are two ways to open a document in edit-mode: first in read-mode then click a button to put it in edit-mode, or open it directly in edit-mode. Both work in all browsers, yet IE seems to handle both cases differently. We found this out when working with the SWING API.
Opening directly in edit-mode in IE (8/9/10) works, via read-mode to edit-mode doesn't. What we found is that the internal representation of a textarea field differs: when opened in edit-mode, there are more properties, but most importantly, the return+linefeeds are correctly set in both the value and the innerText property.
The button just contains a simple Change Mode action.
Has anyone heard of this anomaly? And does someone know what we did wrong?
PS I'll try to build a simple XPage that shows this behaviour more clearly tomorrow.
For IE switching from read to edit mode, you need a full page refresh

HTML link to a certain point in a webpage - slight twist

Here's the use case: A user clicks on a link that opens a window displaying the contents of a text log. Easy enough. But is there a way of using POST, to open that text log to a certain location (i.e., search for a particular timestamp given in the post, and show the file at that specific location)?
(Assume I can't put html tags inside the text log -- it's a raw file).
Template of log:
+++ 2009/06/19 10:47:12.264 ACTION +++
+++ 2009/06/19 10:49:12.111 ACTION +++
So I want the page to load a specific timestamp.
Thanks,
Michael
Why can't you just have a php or perl or simlar script that processes the log file on the spot, and sticks in html anchors and calls it a day?
Doing on the spot processing would also allow you display a trimmed down copy of the log thats only relevant to the timespan around the event in question.
Since you can't modify the file, the only way would be to wrap it in a <frame> or an <iframe> and drive the searching and scrolling from JavaScript in the neighbouring/containing page.
Here's an example, which you can try out online at http://entrian.com/so-container.html
<html><head><script>
function go() {
// "line" is the <input> for which line to jump to; see the HTML.
var line = document.getElementById('line').value;
if (document.body.createTextRange) { // This is IE
var range = frames['log'].document.body.createTextRange();
if (range.findText(line)) {
range.select(); // Scroll the match into view and highlight it.
}
} else { // Non-IE. Tested in Firefox; YMMV on other browsers.
frames['log'].find(line); // Scroll the match into view and highlight it.
}
}
</script></head><body>
<input type='text' size='5' name='line' id='line' value='10'>
<button onclick='go()'>Go</button><br>
<iframe name='log' width='100' height='50' src='so-data.txt'>
<!-- so-data.txt contains the numbers 01-20 on separate lines -->
</body></html>
I've tested that in IE7 and FF3; I'd be surprised if it worked elsewhere without edits, but you never know your luck!
Obviously in your case you'd be driving the scrolling programmatically rather than via an <input> box, but you can see how it would work for you.
If you could put some tags around the file's text, then you could probably insert some javascript that would scroll the window after loading it.
Yes, but passing your parameters via a querystring would be a whole lot simpler.
To scroll to a certain position in the text file you will need to user javascript (overly complicated in my opinion) or add an html anchor tag.
If you were planning to post the raw text log in a window, you will also run into some difficulty as HTML will not recognize the newlines and run the log together into one blob.
have you tried
window.open ('log.txt');
window.scrollTo (0, window.scrollMaxY);
? From mozilla reference : https://developer.mozilla.org/en/DOM/window.scrollMaxY
Keep a 'living copy' of the log file that has been translated to HTML - every time the original file is modified (or simply every X seconds), check for and append the newest lines with HTML anchors applied to the HTML version.
A new feature was added to Chromium waaaaay back in 2020 that allows you to link to ANY location on any webpage.
At the time of this writing, it works for sure in Chrome and Opera but not yet in Firefox, Safari or Brave browser.
The trick is to add:
/#:~:text=
and follow the equal sign with the desired search text, replacing any spaces with %20. Example:
There is no ID near this location on the page
<div>IMPORTANT: Use Opera or Chrome to open above link</div>
For more information:
Linking to a specific part of a web page