Kasper

Tag: frontend (page 2 of 2)

Fronteers

Today on my 24th birthday I joined the Fronteers association, this organisation is focussed on improving the level of knowledge of Dutch frontend developers. I am looking forward to follow some courses and I hope to be able to visit the conference.

 

Create string from jQuery object

Examine the following:

​<div class='item'>
    Here is some sample text.
    <a class='​​​​​​​​​​​​​​​​​​​​​​item-of-interest'​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ href='#'>add</a>
</div>
									

The “Here is some sample text” might be there but not always. What you then want to check is whether the inner html of $(‘.item’) is equal to the link item alone. Since .html() returns a string representation of the html and $(‘.item-of-interest’) returns a jQuery object, you will have to find a way to convert this object to a string representation. The easiest way to do this is by using the following code:

var html = $('<div>').append($('.item-of-interest').clone()).html();
									

You temporarily create an element to which you append the .item-of-interest, then you request the inner html of it.

How To: Make Firefox pass “browser checks”.

Ever tried to use a web application (ie. iCollege) but realized that you couldn’t because in the system check section recognized that firefox was running on linux which was not compatable. Well here is a quick tweak that will make web sites see your computer as running a Windows or Mac OS.

1. Open up firefox and in the search type in

about:config

2. You will be prompted to proceed, proceed.

3. Right click on any value and select New>String

4. A window will pop up, type in

general.useragent.override

5. Another window will pop up. If you are running firefox 3.6.10 type in

Mozilla/5.0 (Windows; U; Windows NT 6.1; ro; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10

If you are running another version go to: http://www.useragentstring.com/pages/Firefox/ and search for your version of firefox (you can find your version by going to Help>About Mozilla Firefox). Once you find your version, look for a the windows user agent (The title will contain something like Windows NT 6.1) then copy the user agent and paste it in the second window.

6. Save the configuration and restart firefox

Now, websites will recognize your computer as running Win7 and will pass you on the browser check.

This post was made by tekkidd on the Ubuntu forums.

Newerposts

Copyright © 2019 Kasper

Theme by Anders NorenUp ↑