Like SystemiConnectFri 15 Oct 2021, 04:50
Auto Save MessagesLGforumFri 26 Feb 2021, 13:31
New tutorial questionTheCrowMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)LGforumSun 14 Feb 2021, 01:25
LGforum (2806)
Script problem Vote_lcapScript problem Voting_barScript problem Vote_rcap 
Mr.Easybb (1587)
Script problem Vote_lcapScript problem Voting_barScript problem Vote_rcap 
Bloodbath (745)
Script problem Vote_lcapScript problem Voting_barScript problem Vote_rcap 
Rukiafan (533)
Script problem Vote_lcapScript problem Voting_barScript problem Vote_rcap 
Dom (513)
Script problem Vote_lcapScript problem Voting_barScript problem Vote_rcap 
puppycheese (446)
Script problem Vote_lcapScript problem Voting_barScript problem Vote_rcap 
pedro (330)
Script problem Vote_lcapScript problem Voting_barScript problem Vote_rcap 
Neymar (301)
Script problem Vote_lcapScript problem Voting_barScript problem Vote_rcap 
Hitsu (281)
Script problem Vote_lcapScript problem Voting_barScript problem Vote_rcap 
Flora (275)
Script problem Vote_lcapScript problem Voting_barScript problem Vote_rcap 


Script problem

concacconcac
Status : No status yet...

Posts : 2
Join date : 2015-10-26
Mon 26 Oct 2015, 14:17
Code:
$(function() {
$.ajax({
url: "/feed/?f=1",
success: function(ta) {
for (var i = 2; i < 7; i++) {
var HR = $(ta).find("link:eq(" + i + ")").text();
$('<a href="' + HR + '" class="hrlink"></a>').appendTo('.last:eq(' + (i - 2) + ')');
$('<img scr="' + $(ta).find("url:eq(" + i + ")").text() + '" class="last_img"/>').appendTo('.last:eq(' + (i - 2) + ')');                       
$('<br /><strong><a href="' + HR + '">' + $(ta).find("title:eq(" + i + ")").text() + '</a></strong>').appendTo('.last:eq(' + (i - 2) + ')');
}
}
})
})
Work fine, but the one below isn't work:
Code:
$('<img scr="' + $(ta).find("url:eq(" + i + ")").text() + '" class="last_img"/>').appendTo('.last:eq(' + (i - 2) + ')');
I'm using Invision version.
Mr.EasybbMr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!

Posts : 1587
Join date : 2013-01-04
Mon 26 Oct 2015, 17:51
Hey @concac first let me say, it's ok to use jQuery but the way you have it is most likely the worse case and not to be offensive because that's not what I am trying to do but it may seem as though you're new at it all? It's fine either way, in JavaScript or any language you try to keep your code clean and separated. Especially for reasons like this, It's all a jumbled mess and not many people will look it over. But I will. Let's start from the second code, we'll dissect it piece by piece until we have it all figured out. I have class right now so I'll be back to you in a moment.
concacconcac
Status : No status yet...

Posts : 2
Join date : 2015-10-26
Tue 27 Oct 2015, 01:51
im new to jquery, thank for the answer Smile
Sponsored content