HTML5 website compatibility in Internet Explorer - javascript

I was going through a simple HTML5/CSS3 tutorial to build a basic website.I closely followed the tutorial to make myself understand the newly added tags use and developed what was taught online step-by-step.
However, the demo of the site I was creating worked fine on Internet-Explorer8 but when I completed my own development, though it worked fine in Chrome and Firefox but it didn't pick any design when I tried run it on Internet-Explorer8.
This however I understand is due to old versions of IE's not supporting newly added elements of HTML5 thus added a script HTML5shiv.js.
This should work fine however IE8 kept popping up the dialog box displaying that : It blocked some Active Content due to security reasons and if required, you can allow them to dosplay. This was never the case with the demo version of the website that I was making.
However, when I allowed the ActiveX controls in the IE8, everything worked fine.
The issue with me now is that if any of my website's user has disabled ActiveX-Controls in IE6,7 or 8, then my website would loose it''s designed structure. How can I get through it?

I assume you are loading html5shiv.js from a separate domain, if so try downloading it and hosting it with the rest of your website. This should solve your problem.
If you're developing your website locally (i.e. directly opened from a file on your computer), that can also cause this problem.
Update to users comment:
Hosting it should solve it. Instead of buying hosting though you could simply host on your localhost, to do that look into using something such as WAMP, or MAMP for Mac.
Alternatively, you can add <!-- saved from url=(0017)http://localhost/ --> to the top of your document which should disable the security policy. You can read more about that here.

Related

WordPress error "This widget requires javascript"

My wordpress Website https://www.paramountplus.com.au/ frontend not works in Internet explorer. When i login to admin section from IE i see this error "This widget requires javascript" and the wordpress dashboard menu not works.
Same website i upload in subdomain https://www.test.paramountplus.com.au/ where everything works fine.
I have uninstalled the wordpress from main domain and install a fresh wordpress for test, but same error in main domain.
Please help me to fix this error.
If it works in the other browsers it probably means that:
-you internet explorer version is really old
-you do not have some plugins or javascript enabled
So check for updates and then in settings look for the plugins section and enable javascript
Problem with IE, probably. If no JavaScript is executing, this might mean that the browser has JavaScript disabled. Check that first.

why plugin blocked by Safari?

My plugin almost works fine in Safari for Mac, but sometimes it is blocked by Safari(see at Safari - Preferences - Security - Manage website setttings).
so my first question is how can I let my plugin be a "Allow Always" plugin in Safari without user's operation?
And when plugin is blocked, Safari will display a placeholder instead of the Internet plugin content. look here
so the second question is when Safari block my plugin(maybe user choosed), how to know it by JS?
Your comments above made it more clear what you were trying to accomplish. It has already been established that if your plugin is blocked than no code inside your plugin will be executed (for security reasons) but it is possible to let your website know if the plugin was loaded (or not loaded) using injected scripts. Here is an example on the Apple developer page showing how an injected script can access a JavaScript function.
In this document you will find everything you need to know about access and restrictions for your plugins and extensions
And this document will help you understand messaging and proxying between different components of your plugin and the website.

Strange website redirect issue on mobile browser that's influenced by cache

I'm at a loss here.
I have a new Wordpress site at synergration.com.
If you access it on a mobile device (phone, not tablet) it will generally load fine the first time. Once you click on to another page and/or reload the home page it jumps into a redirect loop indefinitely attempting to reload the same page over and over and over...
I've weeded through the code and have been unable to find any JS redirects. I've also contacted the theme developer and they've been unable to help.
This only became an issue when I started hosting on WP Engine. They use some advanced caching that seems to be the culprit here as when I test the mobile site on their staging server (where no cacheing exists) it loads fine.
I contacted WPEngine about it and this was their reply:
This is being caused by our caching systems that run on our platform.
It looks like the theme is handling an internal redirect that detects
the user agent (desktop or mobile) and redirects the visitor to the
appropriate site based on that information. However, the redirect is
getting stuck in cache, causing the mobile version to load in an
infinite loop. Unfortunately, we don’t have an easy solution for this.
If this were only one part of the site, we could just exempt that part
of the site from caching, but because it covers the whole site,
exempting from caching isn’t an option. Our staging area is exempt
from all caching, which is why it’s working normally there. (The old
host was most-likely using a non-cached environment, which is why you
didn’t see this issue there). I would contact the theme developer and
ask them if they’ve ever come across this issue before. There’s a good
chance they have, and they might have a clever solution as a
work-around. You might have the option of disabling the mobile
routing, which would solve the redirect issue, though mobile devices
would load the full version of the site rather than the slimmed-down
mobile version.
As noted above, the theme developer didn't have any solution and I'm back at square one so I figured I'd reach out to stack to see if ya'll had any ideas.
I have two sites on WP Engine with redirect. They are identical gensis child themes and redirect plugins. I have one setup with a DNS redirect to a cname record for a "M.sitename.com" URL and the other redirecting to the mobile site that is having the same issue you noted above. I haven't had an issue with the site that points to the cname record. I am about the change the other site to the cname configuration to see if it makes a difference. I have no ideal why this works, but thought you might find this of value.
It works absolutely fine in my mobile's Opera Mini browser. To answer your question, an alternative way is to just create a mobile subdomain, like m.yourdomain.com. Make this decision public and let mobile users know in advance that that is the site for mobile users. A specific mobile site is loads better than visiting the page and then being redirected. It also saves time.
While developing the mobile site, keep in mind, to use minimal JavaScript. The reason being, that older mobile versions may not support JavaScript and if JavaScript is essential then it becomes a big problem.
Speaking about the theme, if it is getting stuck and developer has no idea, so the best option, FOR NOW, is change the template. Let the developer inspect on his very code. You can by that time use another template, that'll keep the site up running well whether it is on Mobile or anything. Because, small errors can divert lot of traffic from your site. I, to be frank, have no idea about what caching problems WP is having, and I don't expect anyone here to be knowing that, so it really depends on time. Till then, as I said, do try to use some other template for the time-being.
All the best.
I faced similar issue recently. It took good amount of time but I finally figured it out.
To prevent redirect from caching, you have to use 302 redirect. Moreover, you have initialize this redirect in "template_redirect" action of wordpress. If you do it in like "init", it'll be cache too.

Enable script run in web browser using java script codes

I designed a web page which contains some javascripts, but when I'm running the page in certain browsers like internet explorer my scripts get blocke and the browsers asks for manual enabling of the script in that browser
I need java script or jquery code for enabling script run in any browser automatically. Can anyone help me please?
Thank you
It is impossible for a website to turn on JavaScript if it is disabled in the browser.
Design your site with progressive enhancement and unobtrusive JavaScript in mind.
If, by "certain browsers like internet explorer", you mean "Internet Explorer will not run my code" (as opposed to "Browsers wil JS turned off will not run my code") then you may just need to learn how to write cross-browser compatible code.
Without a specific example of code that does not work (along with the specific error messages you receive), that topic is too broad to cover on StackOverflow.
Sounds like you are running the website locally, ie opening the file not serving it from a web server. Try running a local web server or hosting your site on a free online service and as long as the browser doesn't have JavaScript disabled the messages shouldn't show up.

Facebook app iframe + JS Facebook.init + IE7 + Flash9 sandbox error

During facebook iframe application integration I ask for publish permissions - I have HTML which loads JS Connect library and asks for permission dialog..
FB_RequireFeatures(["XFBML"], function(){
FB.Facebook.init("_MY_API_KEY", "MY_PATH/xd_receiver.htm");
FB.Connect.showPermissionDialog('publish_stream');
However in IETester with IE7 i get weird errors
SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller http://b.static.ak.fbcdn.net/rsrc.php/zDVWA/hash/bqv7w2jc.swf cannot access ..(MY APP PAGE)
at flash.external::ExternalInterface$/_initJS()
at flash.external::ExternalInterface$/addCallback()
at flashutils::PostMessage()
at XdComm()
As far as i understand xd file is intended for flash proxy that uses this ExternalInterface to communicate with facebook and show dialog. After i click OK, everything seems to work further.
Can anyone clarify what can cause this?
IETester isn't perfect, simply because it cannot fully emulate a proper IE environment. When things get tricky, it starts to give weird errors. And there isn't much trickier than a cross-domain Facebook iframe application.
I would find a real installation of IE7 and check if the problem exists there. If it doesn't, it's probably not worth your time. Microsoft provides a Virtual PC application that is excellent for this kind of thing, as well as many XP and Vista test images containing various versions of IE. They are large downloads, but I highly recommend them over IETester.

Categories