cross-browser

How is it that Javascript can function differently from browser to browser?

笑着哭i 提交于 2019-12-04 15:12:17
I don't think I need to provide examples because every web developer knows that you need to test your Javascript to make sure it's compatible across different browsers. What I don't get is why . Isn't Javascript Javascript? It'd be like the .NET framework behaving differently on one computer than it does on another. Can anyone shed some light on this, possibly with some source links to go along with their answer? Read this -> http://www.quirksmode.org/js/intro.html there are lots of version of the JavaScript implementation - all of them have differences. The short answer is every browser

Read Attributes of SVG-Elements in HTML via JS

[亡魂溺海] 提交于 2019-12-04 15:09:33
问题 I have the following markup (HTML with native SVG): <!doctype html> <!-- ... html-Elements ... --> <svg version="1.1" ... > <defs> <circle id="infop" cx="0" cy="0" r="9" /> </defs> <!-- ... svg Elements ... --> <svg> <!-- to have separate coordinate-system --> <g id="outSvg"></g> </svg> ... A js-method outputs a line and several <use href="infotop"> Elements to #outSvg (to become a graph). The <use> Elements have onmouseover-Events to show tooltips. Now, when it comes to retrieving the

Javascript storing/state of global data/object

一个人想着一个人 提交于 2019-12-04 14:51:49
Is there a way to store global data in the window object such that the data can survive page reloads/refresh. So lets say I assign my global data/object - window.myObject = myProductObject And the user refreshes/reloads the page or may be jumps to another page of my website. Is window.myObject still available after the page reload? NOTE -: I cannot store the object in a cookie, since its a object, I mean it could be a reference to another custom object or it could refer to another "window" object which has opened via "window.open" Use the window.top.name hack var data = window.top.name ? JSON

Multiple versions of same browser on PC

眉间皱痕 提交于 2019-12-04 13:08:44
I am running Windows 7 on my machine. I have following web browsers installed: Opera Google Chrome Safari (windows version) Firefox 3.6 IE 8 I am doing some development running on my local IIS web server and need to test my .net web application development cross browser. So I need to have older versions of the above browsers installed on my machine, eg IE7, Firefox 3 etc What is the best approach for doing this? I have my doubts that different versions can co exist on same machine. Do I need to use a virtual pc? Or are there any applications available for such cross browser testing? Jon

@font-face fonts showing blurred on Mac in Safari and Chrome

不想你离开。 提交于 2019-12-04 13:03:45
I'm using two special fonts on my website for headings and subtitles. They are working fine on a PC in IE, Firefox and Chrome. However, on a Mac in Safari and Chrome the fonts appear emboldened and slightly blurred. The particular fonts I am using are Utopia and Helvetica Neue Condensed Bold. I have generated the font kits using font squirrel based on otf files. I am using the CSS generated by font squirrel. You can see the website at http://shapecast.benmango.co.uk . I also have screenshots comparing the results in the different browsers for Mac and PC at: The code I'm using for the CSS is:

Margin Discrepancies between Firefox and Chrome/Safari

不打扰是莪最后的温柔 提交于 2019-12-04 12:51:43
I seem to have a slight issue with some spacing in between my lines between Firefox and Safari/Chrome. This first image is how the links on the left, and the line of text after the table on the bottom are supposed to look like: How webpage looks in Safari/Chrome As you can see, the links are lined up well with the rectangle "first genesis group" logo. This is how it looks in firefox As you can see, the links are a bit stretched vertical on the left, thus somehow causing the bottom line to shift downwards a little. I found the issue being a margin-top:1px; that I gave to every link in the set

Best method to determine if viewport or 'standard' browser

巧了我就是萌 提交于 2019-12-04 12:43:23
So, by now we all know that iOS mobile Safari uses viewports (as does Android browser), rather than a 'standard' browser window. And this causes issues with overflow:hidden , and position:fixed . This unfortunately is the same case with the iPad. I presume this is the case for other Android tablets too. Rather than browser sniffing each time, is there an easy way to determine if the browser has a viewport or if it is standard? Unfortunately, there's currently no good fix for mobile browsers' lack of support for position:fixed . The reason position:fixed is "broken" in the first place is

IE6 min-height dilemma

本秂侑毒 提交于 2019-12-04 12:33:24
问题 Here is my site: http://smartpeopletalkfast.co.uk/ppp/home-page.html I want the input forms to be the same height as the buttons to their right. I've done this with a min-height value so the page would still be usable if the text size was set to greater than this height. The problem is that IE6 doesn't recognize min-height. I could set a fixed height, but I'm worried about users resizing the text beyond this. As it's only a cosmetic issue, I'm tempted just to leave this. Any suggestions?

How to get iframe contentWindow height in cross domain

北战南征 提交于 2019-12-04 12:19:46
问题 i want to auto adjust my iframe height according to their content but in same domain it's work properly with contentWindow.height but in case of cross domain its permission denied for accessing iframe dom. 回答1: For modern browsers you can use the window.postMessage function to communicate between the iFrames belonging to two different domains. There are also several jQuery plugins that wrap window.postMessage with older URL hashing techniques for browsers that don't support window.postMessage

Adding HTML5 query selector to browsers dont't support it

寵の児 提交于 2019-12-04 12:17:47
I'm using HTML5 selectors API aka querySelector all the time. Those selectors are really easy to use and handful. If you're not familiar with this API it's pretty much similar to jQuery selector API they get a CSS selector string and select right elements. For example these selectors works same: jQuery('#div') == document.querySelectorAll('#div') jQuery('.myClass a') == document.querySelectorAll('.myClass a'); Browser support of this API is pretty good. IE8 supports them. The only two browsers that don't support this API is IE7 and IE6. I'm looking for solution to add this functionality to IE7