By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,680 Members | 1,666 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,680 IT Pros & Developers. It's quick & easy.

detecting opera ? and more..

P: n/a
hi,

how to detect opera..it seems that even opera8 doesnt support
xmlhttp fully (.i.e. sendRequestHeader). I ask this 'cause opera
seems to mimic IE, at least in the preferences ?!

I havent used opera till now, but it seems very buggy piece of software
!!
I have one very annoyng problem, fighting already ~4 hours.
I found that if I use something like this in table (test are
continuing) :

<td>
<form method=post action='action.pl?id=X' ....>
<input type=submit ...>
</form>
</td>
......similar forms follows..

the page is not rendered at all..no prob under firefox.
Anyone to have idea how to solve this too...

Jul 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a


raptor wrote:

how to detect opera..it seems that even opera8 doesnt support
xmlhttp fully (.i.e. sendRequestHeader). I ask this 'cause opera
seems to mimic IE, at least in the preferences ?!


window.opera is a way to detect Opera but usually you should try to
check for a feature you are going to use e.g.
var httpRequest;
if (typeof XMLHttpRequest ! = 'undefined') {
httpRequest = new XMLHttpRequest();
}
else if (typeof ActiveXObject != 'undefined') {
httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
}
if (http) {
httpRequest.open(...);
if (httpRequest.setRequestHeader != 'undefined') {
httpRequest.setRequestHeader('header-name', 'header value');
}
...
}

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

P: n/a
raptor wrote:
how to detect opera..
You don't. It is counter productive to ever be interested in the type or
version of a web browsers, because it is impossible to accurately
determine that information.
it seems that even opera8 doesnt support
xmlhttp fully (.i.e. sendRequestHeader).
Would that be - setRequestHeaders -? If you want to know whether an xml
http request object has a - setRequestheaders - method you test the
object to see if it has that method. Such a test is 100% discriminating
and requires no interest in the type or version of the browsers. And it
will still be 100% discriminating on future versions of Opera 8, which
may add support for that method.
I ask this 'cause opera
seems to mimic IE, at least in the preferences ?!
If you mean the User Agent http header, and the correspo0onding -
navigator.userAgent - string, then yes, spoofing other browsers in UA
headers/strings is common, normal and permissible (by HTTP
specification). Microsoft started the practice, so nobody has a right to
complain that IE browsers are now the main target of spoofing.
I havent used opera till now, but it seems very buggy
piece of software !!
In my experience it is a lot more stable than IE 6. And not implementing
methods on non-standardised objects is allowed, if regrettable.
I have one very annoyng problem, fighting already ~4 hours.
I found that if I use something like this in table (test are
continuing) :

<td>
<form method=post action='action.pl?id=X' ....>
<input type=submit ...>
</form>
</td>
.....similar forms follows..

the page is not rendered at all..no prob under firefox.
Anyone to have idea how to solve this too...


That mark-up, in isolation, is not a problem for Opera 8 (unless taken
literally, where the sequences of dots are distinctly unexpected). You
won't solve problems on Usenet by keeping the problematic code to
yourself, though an HTML group would be more appropriate for mark-up
problems anyway.

Richard.
Jul 23 '05 #3

P: n/a
> how to detect opera..it seems that even opera8 doesnt support
xmlhttp fully (.i.e. sendRequestHeader). I ask this 'cause opera
seems to mimic IE, at least in the preferences ?!
I second the recommendations you've seen about detecting the support for
setRequestHeader rather than detecting a specific browser name and/or
version. Much simpler, and virtually bullet-proof.
I found that if I use something like this in table (test are
continuing) :

<td>
<form method=post action='action.pl?id=X' ....>
<input type=submit ...>
</form>
</td>
.....similar forms follows..

the page is not rendered at all..


Sample URL for this problem?
Since this is a markup question and off-topic for the group feel free to
follow up by E-mail.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.