Being in a third world country brings forward many challenges that would be present in a first world country. One would think with the state of lack the would be a high number of opportunities of development projects for people to hire a developer, especially for your undeveloped settlements. Yet the lack of knowledge tends to keep local business’s to value the same traditional systems that they are used to.
Yet this very weakness with a different lens eye’s out opportunities that would not be commonly seen. In this project I’ve developed a SAAS platform for people to run any form of voting competition that they want. Targeting pageants to even having dance, rap, singing etc basically anything that could required a pole for people to vote online.
This snipped of JavasScript code is there to take action if a user copies an iFrame from youtube to share for a specific contestant. The script will extract the src code url and remove everything else that isn’t necessary so that the user does not have to deal with trying to figure out how to extract the url link, especially if they are not coders, which is to be expected.
if($("#can_youtubeurl").length > 0){ //check for Iframe $("input#can_youtubeurl").on("input", function() { let textArea = $(this).val(); let checkFrame = textArea.indexOf("<iframe"); if(checkFrame == 0){ let stringIndex = textArea.indexOf("https://www.youtube.com/embed"); let result = textArea.substring(stringIndex); let stringColonIndex = result.indexOf('"'); let frameurl = result.substr(0, stringColonIndex); $('input#can_youtubeurl').val(frameurl) } }); }
Vocal Technologies: WP PHP, JavaScript