drewbrolik / Responsive-Img

Responsive Img is a jQuery plugin that changes an image's src attribute based on its container's width.
207 stars 36 forks source link

relative path to images determined solely in PHP, fixing issues with SEO... #6

Closed ChrisKam closed 10 years ago

ChrisKam commented 10 years ago

... URLs etc.

Replaced the method of counting the slashes in "pathToPHP" to determine the relative path from the PHP to the images. Thus, the "baseurl" no longer needs to be submitted from the JS to the PHP.

Script now works with SEO Urls of the /category/subcatory/article.html kind which necessitate an additional "/" in the pathToPHP variable. Furthermore, images can now be placed above the root directory as well.

hellquist commented 10 years ago

Thanks for this edit, it fixed a similar problem for me and now I didn't have to spend too much time thinking about solving it, as this turned it all into copy/paste. :)

ChrisKam commented 10 years ago

You're welcome - I really like your website by the way, gives me faith in my plan to blog about things that are career-related technical stuff alongside more general topics :)

drewbrolik commented 10 years ago

That's great that it worked out. Sorry I've been so slow to merge this in. Everything looks good at first glance. I'll shoot for this weekend... there's no excuse for my slowness haha.