This is a cool tip I picked here on JenSocial to add content at the bottom of every forum post.

 

<!-- Special Ad or Content Bottom of All Forum Discussions/ Code Provided by JenSocial.com. Do not remove credit. -->
<div id="tmp_insideforum" style="display:none;">
<img>
</div>
<script type="text/javascript">
if (typeof(x$) != 'undefined') {
x$(".xg_widget_forum_topic_show div.discussion div.description").after('<div id="insideforum"></div>');
var t_insideforumCode = document.getElementById('tmp_insideforum');
var insideforumCode = document.getElementById('insideforum');
insideforumCode.style.backgroundImage="url('http://storage.ning.com/topology/rest/1.0/file/get/1212722114?profile=original')";
insideforumCode.style.backgroundRepeat="no-repeat";
insideforumCode.innerHTML = t_insideforumCode.innerHTML;
}
</script>
<!-- End Special Ad or Content Bottom of All Forums / Code Provided by JenSocial.com -->

I've modified it to add a simple red line in view of eventually putting short site-wide messages when needed. It worked great except that...

It took us two weeks with the help of Mayra from Ning support to figure out that it was that bit of code that caused our Advanced panel to give us weird intermittent LESS compile errors when just hitting Preview,  that without making any change to either LESS or CSS, just Preview!

Chrome was unusable, Safari and Firefox barely, only Opera could be used to make any CSS change.

Ning said they couldn't reproduce the problem and that it was up to me to figure it out by elimination. It took me a while, going through my CSS, LESS and Custom Code to find out which bit was causing the Advanced panel to malfunction.

Now I know a little bit of JavaScript, jQuery and the Ning API, and I've been staring at that bit of code for a few days and can't figure how in the world it can screw up so weirdly the Developer Mode's Advanced Panel for some browsers, sometimes while displaying a perfectly valid webpage.

Ning works in mysterious ways!

Anyone has a clue?

Views: 186

Reply to This

Replies to This Discussion

hmmm, maybe you should remove the credits. =) That stinks. I can't imagine how the code would mess up the Dev Mode. I'll try to take a closer look with fresh eyes. One thing that stands out for me on quick look, the img tag with no image:

<img>

Still, very surprised this code could cause the dev mode to malfunction. But you're right. Ning can be a mystery. Sorry this happened to you. Always remove all Custom Code when any problem arises. And add the blocks of code back, one at a time.

Best,

Jen

The error was a "URL:match" error. Other admins on the network had the same problem, so it was not a matter of browser cache. The most puzzling aspect was its intermittence: I could make one or two changes on any given day, no more.

Yeah, Custom Code and extra CSS, one by one... Major pain in the butt, if you ask me.

I'll experiment some more with this and let you know if something comes up.

It's a great tip and I'd love to make it work: I want to add a "Jump to the latest reply" link at the bottom of each post. It should have been a piece of cake but...

BTW - Your tip works flawlessly on my test network =/

Update:

It seems to have been the empty <img> tag that was crashing the Dev Mode.

For what reason? Search me!

RSS

Members

© 2024   Created by JenSocial.   Powered by

Badges  |  Report an Issue  |  Terms of Service

Home
VIP Ning Tips