Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function hd1_done(data) {
- alert('URL success!');
- if (data.indexOf('youtu.be') > -1) {
- alert('youtube link!');
- video_uuid = data.substring(17);
- text = '<iframe src="https://www.youtube.com/embed/'+video_uuid+'" frameborder height="315" width="560"></iframe>'; else
- } else if (data.indexOf('png') > -1 || data.indexOf('jpg') > -1) {
- alert('image url!');
- text = '<img src="'+data+'" height="420" width="240"/>';
- } else { // other sites to resolve go here
- alert('Normal link!');
- text = data;
- }
- $(this).html(text);
- }
- function hd1_mouseOver(evt) {
- alert('in mouseover');
- var thePage = $(this).text();
- alert('got url '+thePage);
- $.ajax({
- url: '/title',
- data: {
- "page": thePage
- },
- dataType: 'text',
- success: hd1_done,
- context: this});
- }
- function hd1_load(jQuery) {
- alert('document is ready!');
- $('.link a').on("mouseover", hd1_mouseOver);
- }
- $(document).ready(hd1_load);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement