Skip to content

Noscript #10

Closed
wants to merge 4 commits into from

2 participants

@jweir
jweir commented Apr 4, 2012

I have a solution to the "no javascript" problem. Let me know what you think.

I wanted to just wrap the img tag (with a default src attribute) in a noscript tag. Then scan the noscript and rebuild the dom as necessary. But IE doesn't allow access to the DOM of noscript. So the solution isn't as elegant as I would like.

see unit/test.html and the README for examples

Also...

I want to see the README dive right into how Molt works, so I moved the "reasoning" down. I hope that makes sense to you.

jweir added some commits Apr 4, 2012
@jweir jweir molt.noscript will scan for images in noscript tags and add them to t…
…he DOM

the noscript tag must have the class 'molt-ir'
236033a
@jweir jweir Updated README
Move the reasoning down to the bottom of the page.  
Have the README get right into what Molt is and how to use it.
2b6f352
@jweir jweir highlight W dependency in the README 17a6694
@jweir jweir fix noscript for IE
Had to change the syntax since IE does not allow access to
the noscript tag contents
33459a0
@pyrsmk
Owner
pyrsmk commented Apr 5, 2012

Awesome!

I agree with your changes in the README. But, maybe we shouldn't use cambelt.co generated images for unit tests since it's not always the case that we have internet.

Also, I think we should merge the noscript() method to the discover() one.

@pyrsmk
Owner
pyrsmk commented Apr 5, 2012

Furthermore, you need to update molt version int molt.js and README.markdown to 2.5.0. And, also, build molt to have the minified versions ;)

@jweir
jweir commented Apr 5, 2012

Not using cambelt.co is fine. This was a sketch to see if you liked the idea.

If you think noscript() is best incorporated in discover(), so be it. It will probably need to be updated – if it is called more than once there might be negative side effects.

@pyrsmk
Owner
pyrsmk commented Apr 6, 2012

Uh... I see what you're talking about. Maybe we should drop parsed noscript markups?

@pyrsmk
Owner
pyrsmk commented May 17, 2012

What do you think about that? ^^

@jweir
jweir commented May 17, 2012

Maybe, I am not sure.

I ended up taking a different route. I needed to have something like molt, but I didn't need the screen resize/refresh.

I took your concept and created a new script. It depends on jQuery, doesn't have any noscript support (it isn't needed in my case), also it loads images in a controlled manner – which is critical in my cause since there might 90 hi res images on a page. It all our loaded at once it takes longer to see the first few images.

https://gist.github.com/2719090

@pyrsmk
Owner
pyrsmk commented May 18, 2012

I don't exactly understand... What is the differences between our scripts?

And why do you want to drop W features (refreshing on resize/zoom)? It could be interesting if I put W features as an option in molt, maybe.

@jweir
jweir commented May 18, 2012

Here is what is different:

The block of sizing code is separate from the URL. This made it bit easier to code, although using the "*" for a replacement might bite me.

I don't need the W support. I need to load image sizes based upon the device's screen size, not the window size. The last thing I want is to load new images when the screen resizes.

I need orderly loading of images. The faster the first, second, third, ... image load, the better.

My images come from different hosts. The browser will try to load more than three images at a time. This slows down the time to see the first image. So my script has stricter controls on how images load.

Finally, having a jQuery dependency is not a bad thing for my needs.


Molt is solving a slightly different problem. Making W an option might be a good idea, or not. I don't know.

Molt's charm is the html syntax. Once I saw the below, it was an ah ha moment:

@pyrsmk
Owner
pyrsmk commented Oct 29, 2012

Woo, 5 months...

Anyway... Not loading new images when the screen/window resizes could be a great option for molt. And especially loading images in order. I think I'll should put my hands on that thing later, when I'll work on the merge of your pull request ;)

@pyrsmk
Owner
pyrsmk commented Apr 14, 2014

I close that PR. Nowadays, supporting a noscript seems useless.

@pyrsmk pyrsmk closed this Apr 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.