Javascript Inject Images in Post
3 posters
Page 1 of 1
Javascript Inject Images in Post
Technical Details
Forum version : #Invision
Position : Founder
Concerned browser(s) : Mozilla Firefox, Google Chrome
Who the problem concerns : All members
Forum link : chaoticbackup.forumotion.com
Description of problem
I wrote a script that would replace- Code:
<div class='card'>card name<div>
https://jsfiddle.net/epksyL69/5/
But when I tried in on the forum, nothing happened. I ticked the enable on all pages under javascript management. I don't get any errors in the console related to this script. It just isn't doing anything.
Details on this post
Last edited by Dr.Intern on February 3rd 2016, 11:49 pm; edited 1 time in total
Dr.Intern- Forumember
- Posts : 77
Reputation : 3
Language : English
Re: Javascript Inject Images in Post
Hi @Dr.Intern,
The problem with your script is that it's firing BEFORE the document is ready, so when
gets the specified elements by classname it'll return null, because the document has not yet finished loading ; the elements don't yet exist. Note that all scripts in the AP execute in the HEAD section so you should wrap your code with the following :
The above is shorthand for :
You can also use this if you want to stick with native.
The problem with your script is that it's firing BEFORE the document is ready, so when
|
- Code:
$(function() {
});
The above is shorthand for :
- Code:
jQuery(document).ready(function() {
});
You can also use this if you want to stick with native.
Re: Javascript Inject Images in Post
Yes it is. I had marked solved. Thought that would be enough.
For future reference, should I also respond solved? Thanks.
For future reference, should I also respond solved? Thanks.
Dr.Intern- Forumember
- Posts : 77
Reputation : 3
Language : English
Re: Javascript Inject Images in Post
we just like to make sure as there was no reply after the thank post
it would be really nice if you could reply to the Solved post then we would not see it fit to ask LOL
You would not believe it when i say we lock solved icons and some one comes running to us in PM saying Oi you closed my post and it was not solved.
We say why mark it as solved and the reply to that is i must have hit it and not see i have done it
Anyway Thank you .......
it would be really nice if you could reply to the Solved post then we would not see it fit to ask LOL
You would not believe it when i say we lock solved icons and some one comes running to us in PM saying Oi you closed my post and it was not solved.
We say why mark it as solved and the reply to that is i must have hit it and not see i have done it
Anyway Thank you .......
Topic solved and archived
Similar topics
» 2 Javascript Codes on same post
» New post, old post, locked post images
» Editing post colors via Javascript - Won't work now
» cant post images
» Don't See Images On My Post
» New post, old post, locked post images
» Editing post colors via Javascript - Won't work now
» cant post images
» Don't See Images On My Post
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum