jQuery related posts.

Using XDomainRequest object with jQuery

This primairly to work with IE9 and below. IE10+ will just use the jQuery.Ajax method.

Server side I used PHP and generated my $_POST variables based on the $HTTP_RAW_POST_DATA sent.

Recent project –

Months in the making, but finally live. The all new website. Below is a link to a more detailed description of the new site.

[button url=”” style=”blue” size=”small” type=”square” icon=”” target=”_blank”] Introducing the new [/button]

Dynamic Link Tag Injection

Using jquery to inject a style sheet seems to break IE7/8. The scenario was when a user passed in a custom param via the URL the code would inject that particular css. Ideally I should have gone with the native javascript way to create the element since it’s still clean and simple. This may not be an issue, but for my particular scenario it was the case.

jQuery version:

$('head').append($('<link rel="stylesheet" type="text/css" />')
         .attr('href', ''));

Native version:

var link = document.createElement('link');
    link.href = '';
    link.rel = 'stylesheet';
    link.type = 'text/css';

© 2018 Aldomatic

Theme by Anders NorenUp ↑