473,772 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FAQ Questions

Just for my own curiosity, what ever happend to the Java Applet that was
referenced in the FAQ along with the HTTPRequestObje ct?
http://jibbering.com/faq/#FAQ4_34

And in http://jibbering.com/faq/#FAQ4_43, any chance of adding a snippet
about this bookmarklet:

javascript:'<co de><ol><li>'+(d ocument.documen tElement||docum ent.body).outer HTML.replace(/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/%20%20/g,"&nbsp;%20"). replace(/\n/g,"<li>")+'<\/ol><\/code>';

I don't recall who wrote it, but it gives you the source of the
document, with line numbers, to make debugging in IE a lot simpler.

<FAQENTRY>
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #1
13 1507


Randy Webb wrote:
Just for my own curiosity, what ever happend to the Java Applet that was
referenced in the FAQ along with the HTTPRequestObje ct?
http://jibbering.com/faq/#FAQ4_34


I think the applet is here:
http://www.galasoft-lb.ch/shop_en.html
though I am not sure about that. And I don't edit the FAQ so I don't
know why the link is no longer there, maybe the restrictions to the free
version of the applet are a reason for that.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
> And in http://jibbering.com/faq/#FAQ4_43, any chance of adding a snippet
about this bookmarklet:

javascript:'<co de><ol><li>'+(

document.docume ntElement||docu ment.body).oute rHTML.replace(
/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/%20%20/g,"&nbsp;%20"). replace(
/\n/g,"<li>")+'<\/ol><\/code>';

I think more testing would be needed on the MacOS version of IE. I
got only one line to display when I visited the Yahoo site. The yahoo
site has a javascript error today.

I picked this line up in this forum. I did not record the author. I
belive it would work with more browsers. It is a good way to display
the resulting html source if you are using document.write:

javascript:(doc ument.documentE lement||documen t.body).innerHT ML.replace(
/&/g,%22&amp;%22). replace(
/</g,%22&lt;%22).r eplace(/\n/g,%22<br>%22)

You may need to delete the line ends when making it into a bookmark.

These lines would be a good addition to the FAQ.

Robert
Jul 23 '05 #3
Randy Webb wrote:
Just for my own curiosity, what ever happend to the Java
Applet that was referenced in the FAQ along with the
HTTPRequestObje ct?
http://jibbering.com/faq/#FAQ4_34
Did you mean:-

<URL: http://jibbering.com/faq/#FAQ4_38 >

- which has the link to the Galasoft applet?
And in http://jibbering.com/faq/#FAQ4_43, any chance of
adding a snippet about this bookmarklet:

javascript:'<co de><ol><li>'+
(document.docum entElement||doc ument.body).
outerHTML.repla ce(/&/g,"&amp;").
replace(/</g,"&lt;").repla ce(/%20%20/g,"&nbsp;20") .
replace(/\n/g,"<li>")+'<\/ol><\/code>';

I don't recall who wrote it, but it gives you the
source of the document, with line numbers, to make
debugging in IE a lot simpler.


As an addition to FAQ4_43 it would make most sense as part of a page on
client-side debugging strategies. However, I have often thought that it
might be a good idea to put a page of javascript URL together. A
collection that could include URLs useful for debugging, but also
examples of how they may be used to subvert things like javascript
validation (as a lesson in why client-side validation should not be used
on its own).

Richard.
Jul 23 '05 #4
Robert wrote:
And in http://jibbering.com/faq/#FAQ4_43, any chance of adding a snippet
about this bookmarklet:

javascript:'< code><ol><li>'+ (


document.docume ntElement||docu ment.body).oute rHTML.replace(
/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/%20%20/g,"&nbsp;%20"). replace(
/\n/g,"<li>")+'<\/ol><\/code>';

I think more testing would be needed on the MacOS version of IE. I
got only one line to display when I visited the Yahoo site. The yahoo
site has a javascript error today.

I picked this line up in this forum. I did not record the author. I
belive it would work with more browsers. It is a good way to display
the resulting html source if you are using document.write:

javascript:(doc ument.documentE lement||documen t.body).innerHT ML.replace(
/&/g,%22&amp;%22). replace(
/</g,%22&lt;%22).r eplace(/\n/g,%22<br>%22)


The only two differences in the two is that the first one numbers the
lines, which makes it a lot easier to see where a particular line number
is. The other difference is outerHTML versus innerHTML. Does outerHTML
work in IE on the MAC?

I believe mine and yours both came from the same thread though.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #5
Richard Cornford wrote:
Randy Webb wrote:
Just for my own curiosity, what ever happend to the Java
Applet that was referenced in the FAQ along with the
HTTPRequestOb ject?
http://jibbering.com/faq/#FAQ4_34

Did you mean:-

<URL: http://jibbering.com/faq/#FAQ4_38 >

- which has the link to the Galasoft applet?


Nah, I looked at the wrong one. Maybe thats why I didn't see it :)
And in http://jibbering.com/faq/#FAQ4_43, any chance of
adding a snippet about this bookmarklet:

javascript:'< code><ol><li>'+
(document.doc umentElement||d ocument.body).
outerHTML.rep lace(/&/g,"&amp;").
replace(/</g,"&lt;").repla ce(/%20%20/g,"&nbsp;20") .
replace(/\n/g,"<li>")+'<\/ol><\/code>';

I don't recall who wrote it, but it gives you the
source of the document, with line numbers, to make
debugging in IE a lot simpler.

As an addition to FAQ4_43 it would make most sense as part of a page on
client-side debugging strategies. However, I have often thought that it
might be a good idea to put a page of javascript URL together. A
collection that could include URLs useful for debugging, but also
examples of how they may be used to subvert things like javascript
validation (as a lesson in why client-side validation should not be used
on its own).


Yes, 4_43 would be a good place for it (or a link to it).

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #6
Randy Webb <Hi************ @aol.com> wrote in message
The only two differences in the two is that the first one numbers the
lines, which makes it a lot easier to see where a particular line number
is. The other difference is outerHTML versus innerHTML. Does outerHTML
work in IE on the MAC?


I had to change the \n to \r to get this one line of Javascript to
work on MacOS 10.2.6 for IE 5.2.

javascript:'<co de><ol><li>'+(
document.docume ntElement||docu ment.body).oute rHTML.replace(
/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(
/%20%20/g,"&nbsp;%20"). replace(
/\r/g,"<li>")+'<\/ol><\/code>';
To mark the end of a line in a text file (...), the MacOS uses a
carriage return (CR, ASCII 13), UNIX uses a line feed (LF, ASCII 10)
while Windows uses a carriage return and a line feed (CRLF).
< http://mathstat.carleton.ca/~help/ma...xplatform.html >

Perhaps, we could include both the Mac and PC line end characters in
the same one liner.

I tried the following one liner and it seems to work on IE 5.0 on
Windows 98 and IE 5.2 on MacOS 10.2.6.

Curiously enough, I had to add more HTML tags to get this line to work
in IE 5.0 on Windows 98. I had to add the standard header stuff.

javascript:'<ht ml><head><title >Source.file.li sting<\/title><\/head><body><cod e><ol><li>'+(
document.docume ntElement||docu ment.body).oute rHTML.replace(
/&/g,"&amp;").repl ace(
/</g,"&lt;").repla ce(
/%20%20/g,"&nbsp;%20"). replace(
/\r\n/g,"<li>").repla ce(
/\r/g,"<li>")+'<\/ol><\/code><\/body><\/html>';

Note: You will probably need to get this all on one line before
pasting into your browser. The one line version is:

javascript:'<ht ml><head><title >Source file
listing<\/title><\/head><body><cod e><ol><li>'+(do cument.document Element||docume nt.body).outerH TML.replace(/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/%20%20/g,"&nbsp;%20"). replace(/\r\n/g,"<li>").repla ce(/\r/g,"<li>")+'<\/ol><\/code><\/body><\/html>';
I guess I will work on an innerHTML version that with all three line
endings.

Robert
Jul 23 '05 #7
Randy Webb wrote:

javascript:'<co de><ol><li>'+(d ocument.documen tElement||docum ent.body).outer H
TML.replace(/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/%20%20/g,"&nbsp;%20"
).replace(/\n/g,"<li>")+'<\/ol><\/code>';

Since IE reports line numbers incorrectly when js files are included in the
source, it might be cool to go request those js files and include them
in-line, also. Then the line numbers that IE reports might be more accurate,
no?

--
Matt Kruse
http://www.JavascriptToolbox.com
Jul 23 '05 #8
Matt Kruse wrote:
Randy Webb wrote:

javascript:'<co de><ol><li>'+(d ocument.documen tElement||docum ent.body).outer H
TML.replace(/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/%20%20/g,"&nbsp;%20"
).replace(/\n/g,"<li>")+'<\/ol><\/code>';

Since IE reports line numbers incorrectly when js files are included in the
source, it might be cool to go request those js files and include them
in-line, also. Then the line numbers that IE reports might be more accurate,
no?

This is a start on it, needs some more tweaking.

j='';k=document .scripts;for(i= 0;i<k.length;i+ +){if(k[i].src){xmlhttp=
new ActiveXObject(" Microsoft.XMLHT TP");xmlhttp.op en("GET",k[i].src,true);
xmlhttp.onready statechange=fun ction(){if(xmlh ttp.readyState= =4)
{j=j+xmlhttp.re sponseText;}};x mlhttp.send(nul l)}}
re=/ /g;
s=document.crea teElement("scri pt");s.src=j.re place(re,'\n'); document.body.a ppendChild(s);

My IE uses the Microsoft.XMLHT TP; others may need to edit it to be
Msxml2.XMLHTTP in the ActiveXObject.

As written, its not replacing the expression. Another one of those bugs
to get out of it. If I alert it (j.replace(...) ), then the \n is there.
But when it appends it, it converts it back <shrug>.

Even then, the line numbers are still worthless. Since it is written, at
the moment, to append it to the body.

I will add it to my list of "crap to do at midnight", to change it so
that it inserts the actual text of the external file into the page
itself. That might take a little work :)

If debugging an external file, I always put it in the document, debug
it, then move it back to an external file.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #9
Robert wrote:
Randy Webb <Hi************ @aol.com> wrote in message
The only two differences in the two is that the first one numbers the
lines, which makes it a lot easier to see where a particular line number
is. The other difference is outerHTML versus innerHTML. Does outerHTML
work in IE on the MAC?
I had to change the \n to \r to get this one line of Javascript to
work on MacOS 10.2.6 for IE 5.2.

javascript:'<co de><ol><li>'+(
document.docume ntElement||docu ment.body).oute rHTML.replace(
/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(
/%20%20/g,"&nbsp;%20"). replace(
/\r/g,"<li>")+'<\/ol><\/code>';


Don't use javascript: URIs where you can avoid it. Particularly your
example creates invalid HTML.
To mark the end of a line in a text file (...), the MacOS uses a
carriage return (CR, ASCII 13), UNIX uses a line feed (LF, ASCII 10)
while Windows uses a carriage return and a line feed (CRLF).
< http://mathstat.carleton.ca/~help/ma...xplatform.html >

Perhaps, we could include both the Mac and PC line end characters in
the same one liner.


There is no need for different versions for Mac and PC. Perl Compatible
Regular Expressions, as supported by ECMAScript implementations , support
alternations:

var b = document && (document.docum entElement || document.body);
if (typeof b.outerHTML == "string")
{
alert(
b.outerHTML
.replace(/&/g,"&amp;")
.replace(/</g,"&lt;")
.replace(/ /g,"&nbsp; ")
.replace(/(\r\n?|\n)/g, "<li>"));
}
PointedEars
--
The only thing worse than infinite recursion is infinite recursion.
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4103
by: softwareengineer2006 | last post by:
All Interview Questions And Answers 10000 Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP) I have listed over 10000 interview questions asked in interview/placement test papers for all companies between year 2000-2005 in my website http://www.geocities.com/allinterviewquestion/ So please have a look and make use of it.
0
4599
by: connectrajesh | last post by:
INTERVIEWINFO.NET http://www.interviewinfo.net FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES NO ADVERTISEMENT
2
7226
by: freepdfforjobs | last post by:
Full eBook with 4000 C#, JAVA,.NET and SQL Server Interview questions http://www.questpond.com/SampleInterviewQuestionBook.zip Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
4
2512
by: Drew | last post by:
I posted this to the asp.db group, but it doesn't look like there is much activity on there, also I noticed that there are a bunch of posts on here pertaining to database and asp. Sorry for cross-posting. I am trying to build a "checklist", where a user can navigate to an ASP page on the intranet which shows a list of "questions" that the user can check off. I am trying to figure out how to do this so that it is scalable, but I am...
8
7985
by: Krypto | last post by:
Hi, I have used Python for a couple of projects last year and I found it extremely useful. I could write two middle size projects in 2-3 months (part time). Right now I am a bit rusty and trying to catch up again with Python. I am now appearing for Job Interviews these days and I am wondering if anybody of you appeared for a Python Interview. Can you please share the questions you were asked. That will be great help to me.
0
1501
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers7.html C# Interview Questions and Answers 6 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers-6.html C# Interview Questions and Answers 5...
1
1625
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers7.html C# Interview Questions and Answers 6 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers-6.html C# Interview Questions and Answers 5...
0
4511
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers7.html C# Interview Questions and Answers 6 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers-6.html C# Interview Questions and Answers 5...
0
3432
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions http://interviewdoor.com/technical/C-Interview-Questions.htm C# Interview Questions http://interviewdoor.com/technical/C-sharp-Interview-Questions.htm C++ Interview Questions http://interviewdoor.com/technical/C++-Interview-Questions.htm
0
2943
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions http://interviewdoor.com/technical/C-Interview-Questions.htm C# Interview Questions http://interviewdoor.com/technical/C-sharp-Interview-Questions.htm C++ Interview Questions http://interviewdoor.com/technical/C++-Interview-Questions.htm
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.