I am developing a script under GreaseMonkey and IE7Pro for a social
website I am involved with.
When accessing some pages (user profiles) a 404 error is returned if the
profile does not exist.
Fx returns the page to me as given by the server.
IE7 "helpfully" transforms the simple body contents of "404-Bad Request"
to something far more elaborate, thus keeping from doing a simple
contents check.
I'm looking for a reliable way to detect these 404's. Anyone have advice? 8 1449
Jeremy J Starcher wrote:
I am developing a script under GreaseMonkey and IE7Pro for a social
website I am involved with.
When accessing some pages (user profiles) a 404 error is returned if the
profile does not exist.
[...]
I'm looking for a reliable way to detect these 404's. Anyone have advice?
IXMLHTTPRequest::status
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
On Wed, 10 Sep 2008 20:39:45 +0200, Thomas 'PointedEars' Lahn wrote:
Jeremy J Starcher wrote:
>I am developing a script under GreaseMonkey and IE7Pro for a social website I am involved with.
When accessing some pages (user profiles) a 404 error is returned if the profile does not exist. [...] I'm looking for a reliable way to detect these 404's. Anyone have advice?
IXMLHTTPRequest::status
PointedEars
Seems that would do it, but I can't seem to access it from with GM or
IE7Pro (unless I missed something in my searching.)
GreaseMonkey runs in a weird space, somewhere below chrome level, yet
above the page level. It doesn't have access to much more than
Javascript has, so if there was a standard(ish) Javascript/DOM method,
that is what I'd need.
(If document.status existed, that would be the cat's meow, I think.)
Jeremy J Starcher wrote:
On Wed, 10 Sep 2008 20:39:45 +0200, Thomas 'PointedEars' Lahn wrote:
>Jeremy J Starcher wrote:
>>I am developing a script under GreaseMonkey and IE7Pro for a social website I am involved with.
When accessing some pages (user profiles) a 404 error is returned if the profile does not exist. [...] I'm looking for a reliable way to detect these 404's. Anyone have advice?
IXMLHTTPRequest::status [...]
Seems that would do it, but I can't seem to access it from with GM or
IE7Pro (unless I missed something in my searching.)
Well, since I had never done anything with Greasemonkey, I went to the
Wikipedia article which lead me to GM's homepage where it says:
| Thursday, June 12, 2008
| Greasemonkey Version 0.8
|
| [...]
| Also:
|
| * GM_xmlhttpRequest now includes the finalUrl property.
And then the "Learn to write scripts" quite naturally led to:
<http://diveintogreasemonkey.org/api/gm_xmlhttprequest.html>
where it says:
| GM_xmlhttpRequest — make an arbitrary HTTP request
So that looks like a good starting point.
GreaseMonkey runs in a weird space, somewhere below chrome level, yet
above the page level. It doesn't have access to much more than
Javascript has, so if there was a standard(ish) Javascript/DOM method,
that is what I'd need.
That is probably why GM provides this object. The GM extension itself runs
on the chrome level where it can use all kinds of XPCOM Components without
constraints, including nsIJSXMLHttpRequest.
I do not know about IE7Pro, though. (What is it anyway?)
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
On Wed, 10 Sep 2008 21:36:06 +0200, Thomas 'PointedEars' Lahn wrote:
Jeremy J Starcher wrote:
>On Wed, 10 Sep 2008 20:39:45 +0200, Thomas 'PointedEars' Lahn wrote:
>>Jeremy J Starcher wrote: I am developing a script under GreaseMonkey and IE7Pro for a social website I am involved with.
When accessing some pages (user profiles) a 404 error is returned if the profile does not exist. [...] I'm looking for a reliable way to detect these 404's. Anyone have advice? IXMLHTTPRequest::status [...]
Seems that would do it, but I can't seem to access it from with GM or IE7Pro (unless I missed something in my searching.)
Well, since I had never done anything with Greasemonkey, I went to the
Wikipedia article which lead me to GM's homepage where it says:
| Thursday, June 12, 2008
| Greasemonkey Version 0.8
|
| [...]
| Also:
|
| * GM_xmlhttpRequest now includes the finalUrl property.
And then the "Learn to write scripts" quite naturally led to:
<http://diveintogreasemonkey.org/api/gm_xmlhttprequest.html>
where it says:
| GM_xmlhttpRequest — make an arbitrary HTTP request
So that looks like a good starting point.
*nods* I can do it that way, but it is hackish since it involves
reloading the current page via GM_xmlhttpRequest.
I was hoping to find a plain-old-regular Javascript-like-you-would-
normaly-use-way to do it.
There might not be one.
>GreaseMonkey runs in a weird space, somewhere below chrome level, yet above the page level. It doesn't have access to much more than Javascript has, so if there was a standard(ish) Javascript/DOM method, that is what I'd need.
That is probably why GM provides this object. The GM extension itself
runs on the chrome level where it can use all kinds of XPCOM Components
without constraints, including nsIJSXMLHttpRequest.
I do not know about IE7Pro, though. (What is it anyway?)
IE7Pro < http://www.ie7pro.com/ is billed as the "ultimate" extension
for IE6 and 7 on XP+. Adds user scripts, crash recovery, Mouse Gesture,
save page as image and a bunch of others.
There is a shim script that makes IE7Pro work with many GM scripts.
>
PointedEars
Jeremy J Starcher wrote:
On Wed, 10 Sep 2008 21:36:06 +0200, Thomas 'PointedEars' Lahn wrote:
>[<http://www.greasespot.net/>] And then the "Learn to write scripts" quite naturally led to:
<http://diveintogreasemonkey.org/api/gm_xmlhttprequest.html>
where it says:
| GM_xmlhttpRequest — make an arbitrary HTTP request
So that looks like a good starting point.
*nods* I can do it that way, but it is hackish since it involves
reloading the current page via GM_xmlhttpRequest.
I was hoping to find a plain-old-regular Javascript-like-you-would-
normaly-use-way to do it.
There might not be one.
Curious. Why can't you make a HEAD request using the URI of the user
profile document resource, and navigate there only if that request is
successful?
[about IE7Pro <http://www.ie7pro.com/>]
ACK, thanks.
PointedEars
P.S.
Please trim your quotes to the necessary minimum to retain context and stop
quoting signatures.
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
On Wed, 10 Sep 2008 22:22:31 +0200, Thomas 'PointedEars' Lahn wrote:
Jeremy J Starcher wrote:
>*nods* I can do it that way, but it is hackish since it involves reloading the current page via GM_xmlhttpRequest.
I was hoping to find a plain-old-regular Javascript-like-you-would- normaly-use-way to do it.
There might not be one.
Curious. Why can't you make a HEAD request using the URI of the user
profile document resource, and navigate there only if that request is
successful?
Ah! There is an idea that didn't cross my mind. I've never done just a
HEAD request, but if it works, that will be a better route to take.
Thanks.
I'll run some tests tonight.
P.S.
Please trim your quotes to the necessary minimum to retain context and
stop quoting signatures.
ACK. I'll kick myself in the seat of my pants to remind me.
You've already received what looks like good advice from Thomas (XHR a
HEAD request and check the status) for this problem, but I wanted to
make a quick comment on your subject line. The information you're
looking for is neither a header nor anything to do with HTML; it's the
HTTP Status-Code. (See RFC 2616.)
I mention this only because the wrong nomenclature could be confusing
for maintainers.
--
Michael Wojcik
Micro Focus
Rhetoric & Writing, Michigan State University
On Thu, 11 Sep 2008 14:14:53 -0400, Michael Wojcik wrote:
You've already received what looks like good advice from Thomas (XHR a
HEAD request and check the status) for this problem, but I wanted to
make a quick comment on your subject line. The information you're
looking for is neither a header nor anything to do with HTML; it's the
HTTP Status-Code. (See RFC 2616.)
Correction accepted. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rainmaker |
last post by:
Greetings,
I have not been able to find the documentation that will allow me to
insert
php code inside the html code in the $message block in the mail() function.
Using the example in the help...
|
by: Cem Louis |
last post by:
Hi to all,
I have the following html mail sender code written in php. It is
working properly but my problem is, code doesn't send the text
correctly which is in the varible "$mesaj". Code sends...
|
by: Ann |
last post by:
Hi,
I am trying to send a html email from a php script. This script emails
a common information to all the members in the database. The only
problem is I cannot specify colors, hyperlinks...
|
by: David ROBERT |
last post by:
Hello,
I need to read data from a MS Access database.
The program (reader) is installed on a linux box and
is written in python langage.
The database is MS Access 2002 installed on a Win XP box...
|
by: Joe |
last post by:
I am trying to read the EventLog of different servers on the network. If I
run the script in a command line, it works well. But when I try to put the
script into the Web server (IIS in Windows...
|
by: MLH |
last post by:
I print to a device that creates a PDF. Knowing the filename, how can
I then embed the PDF into the body text of an OutLook Express outbound
email & send to a specified address in a table? I want...
|
by: Alex |
last post by:
Hi,
My booking system sends a HTML formated email as a recipt to the client
on completion of their booking. All is working well however it has been
pointed out to me that not all people's email...
|
by: M P |
last post by:
Hi!
I am currently working on a project that will migrate MS Access DB and Front
End to web-base solution to reduce MS Access installation. Previously, users
are using MS Access as frontend to...
|
by: robbiesmith79 |
last post by:
Just so this is out there on the web, I battled the past 24 hours
about this. Background info... I developed a ecommerce website in PHP
4 on a shared linux hosting plan from GoDaddy and had the...
|
by: matheussousuke |
last post by:
I'm having trouble with e-mail sending, I mean, the website is suposed to send a confirmation email after sign up, but it gets like text plain instead of HTML
May someone help me, please?
...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |