{"id":534,"date":"2009-01-15T22:08:22","date_gmt":"2009-01-15T21:08:22","guid":{"rendered":"http:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/"},"modified":"2009-01-15T22:08:22","modified_gmt":"2009-01-15T21:08:22","slug":"why-opera-doesnt-work-with-some-web-sites-part-1","status":"publish","type":"post","link":"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/","title":{"rendered":"Why Opera doesn&#8217;t work with some web sites? Part 1"},"content":{"rendered":"<p>Today I received a mail from a friend. Some weeks ago, he tried Opera and then contacted me, reporting some problems with the Vodafone web site. I couldn&#39;t reproduce them because a personal account was needed.<\/p>\n<p>Today he got back to me, reporting another site, Adecco&#39;s. This time, no login was required, so I could dedicate some time to investigate a bit more on what was happening.<\/p>\n<p>The page is the following, from the Adecco italian web site:<\/p>\n<p><a href=\"http:\/\/candidate.adecco.adeccoweb.com\/ecit\/_General\/DataPages\/newCandidate\/candidatesearchoffers.asp?MenuSelectedLevel1=115&amp;Selected=1\" rel=\"nofollow\">http:\/\/candidate.adecco.adeccoweb.com\/ecit\/_General\/DataPages\/newCandidate\/candidatesearchoffers.asp?MenuSelectedLevel1=115&amp;Selected=1<\/a><\/p>\n<p>\nIt&#39;s just a simple form, with some <code>SELECT<\/code> controls and submit button (&quot;Cerca&#8230;&quot;).<br \/>\nThe problem is that using Opera the submit button <strong>does not work<\/strong>.<\/p>\n<p>\nSo, I fired up the <strong>javascript errors window<\/strong>, and I saw:\n<\/p>\n<p><code><\/p>\n<pre>\r\nJavaScript - http:\/\/candidate.adecco.adeccoweb.com\/ecit\/_General\/DataPages\/newCandidate\/candidatesearchoffers.asp?MenuSelectedLevel1=115&amp;Selected=1\r\nEvent thread: click\r\nError:\r\nname: TypeError\r\nmessage: Statement on line 46: Cannot convert undefined or null to Object\r\nBacktrace:\r\n  Line 46 of inline#2 script in http:\/\/candidate.adecco.adeccoweb.com\/ecit\/_General\/DataPages\/newCandidate\/candidatesearchoffers.asp?MenuSelectedLevel1=115&amp;Selected=1: In function multiple_TypeBusinessLines\r\n    \tfor(x=0;x&lt;obj.length;x++){\r\n  Line 81 of inline#2 script in http:\/\/candidate.adecco.adeccoweb.com\/ecit\/_General\/DataPages\/newCandidate\/candidatesearchoffers.asp?MenuSelectedLevel1=115&amp;Selected=1: In function cmdSearch_onclick\r\n    \t\tvTypeBusinessLineId= multiple_TypeBusinessLines().join(gCARACTER_SINGLE_SEPARATOR);\r\n  Line 1 of function script \r\n    cmdSearch_onclick();\r\n  ...\r\nstacktrace: n\/a; see &#39;opera:config#UserPrefs|Exceptions Have Stacktrace&#39;\r\n<\/pre>\n<p><\/code><\/p>\n<p>Ooook. Time to learn Dragonfly a bit more&#8230; I fired up <a href=\"http:\/\/opera.com\/dragonfly\/\" rel=\"nofollow\"><b>Dragonfly<\/b><\/a>, and I dug my way through the innards of this site javascript files. It turned out the &quot;interesting&quot; bits are here (javascript ahead):<\/p>\n<p><a href=\"http:\/\/candidate.adecco.adeccoweb.com\/ecit\/_includes\/jscommonbrowser.js\" rel=\"nofollow\">http:\/\/candidate.adecco.adeccoweb.com\/ecit\/_includes\/jscommonbrowser.js<\/a>\n<\/p>\n<p>\nIf you open up this file in your text editor, you will see a <code>getObject()<\/code> function:\n<\/p>\n<p><code><\/p>\n<pre>\r\n\/\/-----------------------------------------------------------------------------\r\n\/\/ getObject\r\n\/\/-----------------------------------------------------------------------------\r\n\/\/\tConvierte una cadena con el nombre de un Objeto en la referencia\r\n\/\/\tde un objeto. \r\n\/\/-----------------------------------------------------------------------------\r\nfunction getObject(obj) {\r\n\tvar theObj;\r\n\tif (typeof obj == &quot;string&quot;) {\r\n\t\tif (oBrowser.ns6 || oBrowser.ie5) {\/\/si es Netscape6 o Explorer 5\r\n\t\t\ttheObj = document.getElementById(obj);\r\n\t\t} else {\r\n\t\t\tif (oBrowser.ie4) {\/\/si es Explorer 4\r\n\t\t\t\ttheObj = document.all[obj];\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\ttheObj = obj;\r\n\t}\r\n\treturn theObj;\r\n}\/\/ getObject\r\n<\/pre>\n<p><\/code><\/p>\n<p>So, what&#39;s wrong with this function? Who wrote this probably wrote it some years ago, because it&#39;s still testing for <b>MSIE 4.0 or 5.0<\/b>, or <b>Netscape 6<\/b>. Well, no wonder it doesn&#39;t work for Opera. Maybe it doesn&#39;t work for Safari either, nor for Chrome.<\/p>\n<p>\nAnyway, time to fix this. How? As <a href=\"http:\/\/dev.opera.com\/articles\/view\/a-browser-sniffing-warning-the-trouble\/\" rel=\"nofollow\">Hallvord said on dev.opera.com<\/a>, it&#39;s probably a good idea, and this script shows it, to avoid testing for browsers. Let&#39;s test the functionality instead. We need <code>getElementById()<\/code>.\n<\/p>\n<p>\nWhat about this revised version:\n<\/p>\n<p><code><\/p>\n<pre>\r\nfunction getObject(obj) {\r\n  var theObj;\r\n  if (typeof obj == &quot;string&quot;) {\r\n    if (document.getElementById)\r\n      theObj = document.getElementById(obj);\r\n    else if (document.all)\r\n      theObj = document.all[obj];\r\n  } else\r\n    theObj = obj;\r\n  return theObj;\r\n}\r\n<\/pre>\n<p><\/code><\/p>\n<p>\nI reported the problem through the Adecco web site contact form.<br \/>\nLet&#39;s hope that someone will consider it&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I received a mail from a friend. Some weeks ago, he tried Opera and then contacted me, reporting some problems with the Vodafone web site. I couldn&#39;t reproduce them because a personal account was needed. Today he got back to me, reporting another site, Adecco&#39;s. This time, no login was required, so I could [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[495,416,74,48],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Why Opera doesn&#039;t work with some web sites? Part 1 - Random hacking<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why Opera doesn&#039;t work with some web sites? Part 1 - Random hacking\" \/>\n<meta property=\"og:description\" content=\"Today I received a mail from a friend. Some weeks ago, he tried Opera and then contacted me, reporting some problems with the Vodafone web site. I couldn&#039;t reproduce them because a personal account was needed. Today he got back to me, reporting another site, Adecco&#039;s. This time, no login was required, so I could [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/\" \/>\n<meta property=\"og:site_name\" content=\"Random hacking\" \/>\n<meta property=\"article:published_time\" content=\"2009-01-15T21:08:22+00:00\" \/>\n<meta name=\"author\" content=\"cosimo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"cosimo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/\"},\"author\":{\"name\":\"cosimo\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\"},\"headline\":\"Why Opera doesn&#8217;t work with some web sites? Part 1\",\"datePublished\":\"2009-01-15T21:08:22+00:00\",\"dateModified\":\"2009-01-15T21:08:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/\"},\"wordCount\":310,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\"},\"keywords\":[\"browsers\",\"javascript\",\"opera\",\"web\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/\",\"url\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/\",\"name\":\"Why Opera doesn't work with some web sites? Part 1 - Random hacking\",\"isPartOf\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#website\"},\"datePublished\":\"2009-01-15T21:08:22+00:00\",\"dateModified\":\"2009-01-15T21:08:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.streppone.it\/cosimo\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Why Opera doesn&#8217;t work with some web sites? Part 1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#website\",\"url\":\"https:\/\/www.streppone.it\/cosimo\/blog\/\",\"name\":\"Random hacking\",\"description\":\"Assume nothing. Code defensively. Keep it simple, stupid!\",\"publisher\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.streppone.it\/cosimo\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\",\"name\":\"cosimo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g\",\"caption\":\"cosimo\"},\"logo\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/www.streppone.it\/cosimo\/blog\/author\/cosimo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Why Opera doesn't work with some web sites? Part 1 - Random hacking","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/","og_locale":"en_US","og_type":"article","og_title":"Why Opera doesn't work with some web sites? Part 1 - Random hacking","og_description":"Today I received a mail from a friend. Some weeks ago, he tried Opera and then contacted me, reporting some problems with the Vodafone web site. I couldn&#39;t reproduce them because a personal account was needed. Today he got back to me, reporting another site, Adecco&#39;s. This time, no login was required, so I could [&hellip;]","og_url":"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/","og_site_name":"Random hacking","article_published_time":"2009-01-15T21:08:22+00:00","author":"cosimo","twitter_card":"summary_large_image","twitter_misc":{"Written by":"cosimo","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/#article","isPartOf":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/"},"author":{"name":"cosimo","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1"},"headline":"Why Opera doesn&#8217;t work with some web sites? Part 1","datePublished":"2009-01-15T21:08:22+00:00","dateModified":"2009-01-15T21:08:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/"},"wordCount":310,"commentCount":0,"publisher":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1"},"keywords":["browsers","javascript","opera","web"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/","url":"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/","name":"Why Opera doesn't work with some web sites? Part 1 - Random hacking","isPartOf":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#website"},"datePublished":"2009-01-15T21:08:22+00:00","dateModified":"2009-01-15T21:08:22+00:00","breadcrumb":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2009\/01\/why-opera-doesnt-work-with-some-web-sites-part-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.streppone.it\/cosimo\/blog\/"},{"@type":"ListItem","position":2,"name":"Why Opera doesn&#8217;t work with some web sites? Part 1"}]},{"@type":"WebSite","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#website","url":"https:\/\/www.streppone.it\/cosimo\/blog\/","name":"Random hacking","description":"Assume nothing. Code defensively. Keep it simple, stupid!","publisher":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.streppone.it\/cosimo\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1","name":"cosimo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g","caption":"cosimo"},"logo":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/"},"url":"https:\/\/www.streppone.it\/cosimo\/blog\/author\/cosimo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/posts\/534"}],"collection":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/comments?post=534"}],"version-history":[{"count":0,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}