Dynamically embed imgur album into page

53 views
Skip to first unread message

Alex Solanos

unread,
May 31, 2015, 6:14:33 AM5/31/15
to im...@googlegroups.com
Hey!

The user selects some images which are being uploaded through javascript to imgur.

Then, after the upload process is complete, another request is being done in order to create an imgur album using the uploaded images.

Everything works fine till then, but when I get the album id I want to dynamically embed it into the current page.

So, I manipulate the data-id, href and src parameters of the album's embed code and I dynamically insert it into the page. But instead of the normal embedding I just get a blue link with the album's title.

On the other hand, if I copy and paste the resulted code in my initial HTML code, then the album loads correctly (static loading for the same HTML embed code works fine).

So the question is, how do I dynamically load an imgur album into my page?

Alex Solanos

unread,
May 31, 2015, 6:49:07 AM5/31/15
to im...@googlegroups.com
I found the solution. I forgot that just adding the <script> to the HTML is not supposed to work. Instead, I created the script element through jQuery and I added the needed attributes. Then I appended it into the HTML and it works just fine.
Reply all
Reply to author
Forward
0 new messages