doddsey_65 Posted January 20, 2011 Author Share Posted January 20, 2011 the delimiters in the split were not needed. var parts = jQuery(this).attr('class').split("-"); works perfectly. Thanks for the massive help. Couldnt have done it without you Quote Link to comment https://forums.phpfreaks.com/topic/224837-link-id-for-every-result/page/2/#findComment-1162456 Share on other sites More sharing options...
trq Posted January 20, 2011 Share Posted January 20, 2011 It might simply be how your using split. The regex does not need to be within quotes: var parts = $(this).attr('class').split(/\-/); Quote Link to comment https://forums.phpfreaks.com/topic/224837-link-id-for-every-result/page/2/#findComment-1162458 Share on other sites More sharing options...
trq Posted January 20, 2011 Share Posted January 20, 2011 the delimiters in the split were not needed. var parts = jQuery(this).attr('class').split("-"); works perfectly. Thanks for the massive help. Couldnt have done it without you That's alright. Honestly though, your markup has plenty of room for improvement and would make this, and allot of other things in the future much easier to implement I'm sure. Not to mention making your code easier to maintain and more efficient. Quote Link to comment https://forums.phpfreaks.com/topic/224837-link-id-for-every-result/page/2/#findComment-1162460 Share on other sites More sharing options...
doddsey_65 Posted January 20, 2011 Author Share Posted January 20, 2011 the delimiters in the split were not needed. var parts = jQuery(this).attr('class').split("-"); works perfectly. Thanks for the massive help. Couldnt have done it without you That's alright. Honestly though, your markup has plenty of room for improvement and would make this, and allot of other things in the future much easier to implement I'm sure. Not to mention making your code easier to maintain and more efficient. could you give me a hint on where i could improve. I know you have done alot so far but this is the second time i have started the whole thing again in order to improve my coding and such thanks Quote Link to comment https://forums.phpfreaks.com/topic/224837-link-id-for-every-result/page/2/#findComment-1162461 Share on other sites More sharing options...
trq Posted January 20, 2011 Share Posted January 20, 2011 I'm not going to go into specifics, but I would suggest you Google 'semantic markup', and learn about what it is and how it is done. Your markup should describe your data, yours is all over the place. Quote Link to comment https://forums.phpfreaks.com/topic/224837-link-id-for-every-result/page/2/#findComment-1162470 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.