Skip to main content

Posts

Is it possible to lazy load Jquery (not a plugin)?

I've got several JavaScript files that load along with many of my pages, costing valuable tens of kilobytes of data download. One of these is a version of jquery.min.js which although minified, is still 25kb or so. My issue is that a huge chunk of mobile phones don't support JavaScript so the downloading of this and other JS files is a waste of data. Is there anyway to lazy load the JQuery file by adding a <script> tag in the page that calls the JS file and would obviously only execute if a browser supports JavaScript, which would only then make sense to download it?

fetch the hidden text and put it within a div tag

When an anchor tag is clicked, "anotherDiv" is made visible. Using jQuery, I want to be able to fetch the description within each li onClick of the anchor tag and insert it into the "anotherDiv" area which is also visible onClick of an anchor tag. The description text is initially set to display none. <style> .desc{ display:none; } #anotherDiv{ display: none; } </style> <li style="overflow: hidden; float: none; width: 158px; height: 125px;"> <a onClick="return addPlayer(952541791001, 661361792001, 600, 320)" id="no8" class="video-pop"> <img width="132" height="75" alt="" src="image.jpg"> </a> <div class="label">The label goes here......</div> <div class="desc">The descripti

jquery supersized plugin - allow image to scroll with site

I'm developing a site and the client has requested we use the supersized plugin to display a gallery of images - which is fine, HOWEVER the have requested that the background image scrolls with the site rather than being fixed to the browser window. Something like this - http://www.surfcampinportugal.com/ . I've tried amending my CSS (changing position: fixed to absolute) but nothing seems to achieve this effect. Site is on my local server at the moment but I'm using supersized 3.2 with a fade transition - http://buildinternet.com/project/supersized/slideshow/3.2/demo.html Any pointers/ideas would be VERY welcome. Thanks

dynamic key in JSON file (used by backbone.js models for example&hellip;)

I am trying to create a backbone.js model with dynamic keys but can't seem to get it done right. Here's my model: window.MyModel = Backbone.Model.extend({ myDynamicVar : "country", urlRoot: "api/myModel", defaults: { "id": null, this.myDynamicVar : "USA", "country": { "route":"test/test/test", "class":".usa2", "txt":"USA 2" }, "region": "California", "year": "", "description": "", "picture": "" } }); Here I am trying to have myDynamicVar replaced by its content in my model. Any thought how I could get this done? Thanks in advance, Jimmy

Where can I find a very simple jQuery/AJAX Coldfusion tutorial? [closed]

Edit: After following a few tutorials I am stuck here I am new to jquery but have some experience with Coldfusion. I have been desperate for an easy tutorial that shows how jQuery/AJAX pulls a query from a ColdFusion9 CFC and displays it on the HTML calling page. I tried following this ben_tutorial but it is too complex for me. There is also a another tutorial , but I do not want to install a plugin. Where should I be looking? I am googling "jquery ajax coldfusion"

Running JQuery or Javascript on Facebook

I am trying to execute a simple bit of jQuery or JavaScript once logged in to my Facebook account. The end goal at this moment is to click on my custom feed once the element is visible, rather than having it default to the entire Facebook friend feed. On trying to code this using my Developer's Console in Chrome no JavaScript/jQuery seems to work at all. Even just a simple $('div'); returns null . Is it possible to run code on Facebook's page? What are they doing differently? I guess the end goal would be to click a div if the .val('give a waffle'); but just understanding why it has not worked until now would also be interesting. Any hints, tips or suggestions are more than welcome.

Input type=range does not update its value

I have the following: <input id="slider-min" type="range" min="0" max="55" value="0" step="5" onchange="sliderMinUpdate(this.value)">, <div id="min_input">0</div> <input id="slider-day" type="range" min="0" max="10" value="0" step="0.5" onchange="sliderDayUpdate(this.value)"> function sliderDayUpdate(value){ $('#slider-min').val(0); } function sliderMinUpdate(value){ $('#min_input').text(value); } When I focus in slider-min using keyboard and select keypad right or left it updates values in min_input correctly. When I change slider-day it fires onChange and updates the value from slider-min to 0 and I can see it working in my page (the slider returns to 0). The problem occurs when I select the first increment of slider-min , in this case 5. When the onChange from slider-day is cal