JavaScript - Embed Tag Src Problem
My Problem is i have done following code
document.getElementById('d').innerHTML = '<embed src="' + a + '" autostart="true" width="320" height="260" id="HelpVideos">' var y; y = this.document.getElementById('HelpVideos'); but as soon as i click the alert ok button the ebed tag takes its origenal values as it is in origenal html page please solve this i m messed up with this............. thanks in advance Similar TutorialsIs it possible to embed a pls link in javascript? I tried this but doesnt seem to work, what can i do? Code: function Play () { var path = '<embed src="http://www.link.com/music.pls" autostart="true" loop="false" hidden="true" height="0" width="0">'; document.getElementById (file).innerHTML = path + '<img src="images/stop.gif" style="cursor:pointer;" onclick="Stop(' + "'" + file + "'" + ')">'; } function Stop (file) { document.getElementById (file).innerHTML = '<img src="images/play.gif" style="cursor:pointer;" onclick="Play(' + "'" + file + "'" + ')">'; } Hi, I would like to embed 2 or 3 videos in sequence in my orkut profile using the tags <embed>. It is possible? Code: 1<embed src="http://www.youtube-nocookie.com/v/iuczE8vIujc&autoplay=1"loop="true"type="application/x-shockwave-flash"allowscriptaccess="always" allowfullscreen="true" width="400" height="250"></embed>1 2<embed src="http://www.youtube-nocookie.com/v/UqqZm-D6WPo&autoplay=2" type="application/x-shockwave-flash"allowscriptaccess="always" allowfullscreen="true" width="400" height="250"></embed>2 For playing automatically? Regards FG Help! I am trying to get a ball within an image and then send the x, y coordinates to paypal. I'm almost there but the BALL.GIF wont go into the picture. Can anyone help me do this? The second script (getting the coordinates works perfectly.... I just cant figure out how to get the ball in the picture!!) Here's my code: [code] <script language="JavaScript"> function placeCrosshair(e) { var ch = document.getElementById('ball'); var pic = document.getElementById('myImg'); ch.style.left = e.x + 11; ch.style.top = e.y + 11; </script> <script language="JavaScript"> javascript&colonself.resizeTo(900,screen.availHeight);self.moveTo(40,0); var d = document; //Get the img X and Y positions with an onMouseOver event function getCoor(imgId) { x = event.offsetX?(event.offsetX):event.pageX-document.getElementById("clickImage").offsetLeft; y = event.offsetY?(event.offsetY):event.pageY-document.getElementById("clickImage").offsetTop; document.mypaypalform.item_name.value = "Ball position: x=" + x + "\ny=" + y; //this section writes out the coordinates on the page. var data = "<br><h3>Your selected ball position is: x =" + x + " and y =" + y + "</h3>"; if (mypaypalform.layers) { mypaypalform.layers.cust.document.write(data); mypaypalform.layers.cust.document.close(); } else { if (mypaypalform.all) { cust.innerHTML = data; } } } </script> <p></p> <a href="#" onClick="placeCrosshair(event)> <img src="ball.jpg" width="21" height="21" id="ball" /> <a href="#" onclick="getCoor('myImg')"> <img src="picture.jpg" alt="" border="0" height="600" width="850" name="myImg" ismap></a> <br><br> <h3>Click on the payment button to enter.</h3> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="mypaypalform"> <!-- Placeholder for dynamic form contents --> <span name=cust id=cust style="position:relative;"></span> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="buy@buy.co.uk"> <input type="hidden" name="item_name" value="Game - "> <input type="hidden" name="item_number" " value="1"> <input type="hidden" name="amount" value="0.50"> <input type="hidden" name="no_shipping" value="0"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="bn" value="PP-BuyNowBF"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_paynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> Thank you Al I have the following code for an embed that I would like to add to my site. However, the embed is too large for the box I am trying to put it in on my social network. I tried to add height/width parameters, but it did not work. Is there a way to modify the size? Thanks!!! <div id="wb-9ez75d"></div><script type="text/javascript" src="http://flockdraw.com/embed/9ez75d"></script> Hi All, I have a python script on server that automates a certain procedure. It is working fine on the server machine. But for accessing it I need to have a javascript for that. I have a python script named test.py Code: class autoTest(): def auto_ftp_download { } It automates a particular application when run through command line. I have an apache server setup on window XP. I want to have a python code (with embedded javascript on server) to launch this code on client machine once remotely accessed. Clicking on this script on server (test.py) shall start the automated procedure. I used subprocess.Popen but it wont work if remotely accessed. How can I use javascript to launch it? I tried opening notepad.exe using a javascript along with ActiveX object. So on server there was a script named runnotepad.py. Clicking on it reads another file(open("htdocs/test/Upload/wsgi_app/notepad.html", "rb").read()) in the same directory named as notepad.html (with javascript embedded). It worked fine. But I do not know how to make it available to a client to launch that python script (that automates the procedure) from the server?? Regards, Ejaz Shah Hello all, I'm looking for a Market stock bar similar to http://www.bloomberg.com/ I've been looking around and can't find any API's or examples. Could someone point me in the right direction? I am using a javascript replace code to embed youtube videos in my forum. It works fine except users on iPhone or iPad can't see the videos. I would like to added the url to the video under the embed code - so these users can just click the link and see the vid on youtube. Here is the script in question: Code: z[x].innerHTML = z[x].innerHTML.split("[YOUTUBE]").join("<iframe width=560 height=410 src='").split("/watch?v=").join("/v/").split("[/YOUTUBE]").join("' frameborder=0 allowfullscreen></iframe>"); I am not very good with the split & join functions. Can someone help me out.. I would like the code to place the you tube video link like so: Code: z[x].innerHTML = z[x].innerHTML.split("[YOUTUBE]").join("<iframe width=560 height=410 src='").split("/watch?v=").join("/v/").split("[/YOUTUBE]").join("' frameborder=0 allowfullscreen></iframe>< br><a href="youtube video link">View on YouTube</a> "); I have a piece of code which I suppose to click on to activate: Code: <a href ="javascript:(function() { newwindow = window.open(); newwindow.document.write('<html><head><title>Your new title here</title></head>'); newwindow.document.write('<body><embed src = 'http://www.flashppt.com/images/tangramone.swf' height='100%' width='100%'></embed></body></html>'); } )();"> Run flash popup </a> I have spent a very long time looking at it but I still can't figure it out. The problem is with line with <embed> tag. My purpose is to open a swf flash in a new popup window such that it must have a Pretty title name (instead of its addresss). Since opening that SWF directly does not leave me the option of change the popup title , so I use the above method... I appreciate much if you can help ! Hi, I'm trying to get my webcam feed embeded as a flash object. I have the url to the swf generated by the webcam software. If I copy and paste the url into IE's address bar, the webcam shows. However, the same url embeded into html does not work. This directly in IE address bar works. But doesn't in any other browser: Code: http://ipaddresshere/axis-cgi/mjpg/video.swf?resolution=320x240&camera=1 I've looked through the code from the webcam (Axis) admin page and copied the code for the flash option. Here is the code: Code: <html> <head></head> <body> <script language="Javascript"> var width = "320"; var height = "240"; var width_height = 'width="' + width + '" height="' + height + '"'; var view_NeedFlashPluginTxt = "You need a Shockwave Flash plugin, get it from:"; document.write('<EMBED src="http://ipaddresshere/axis-cgi/mjpg/video.swf?resolution=320x240'+'&camera=1" ' + 'quality=high bgcolor=#000000 ' + width_height + ' TYPE="application/x-shockwave-flash" swLiveConnect=TRUE' + ' PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">' + '</EMBED>' + '<NOEMBED>' + view_NeedFlashPluginTxt + '<a href="http://www.macromedia.com/shockwave/download/">Macromedia</a>.' + '</NOEMBED><br>'); </script> </body> </html> and this is the html the Javascript outputs: Code: <EMBED height=240 type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash width=320 src=http://ipaddresshere/axis-cgi/mjpg/video.swf?resolution=320x240&camera=1 swLiveConnect="TRUE" bgcolor="#000000" quality="high"> </embed/> Can anyone spot anything wrong with the code or perhaps suggest why it isn't working? I want to be able to display an embedded video on a web page but i want the URL to be different based on the source IP visting the web page. Can this be done in javascript? Example: If someone from inside our network (one IP address on the outside) visits our external web page (hosted externally) visits a web page with one of the embedded videos the URL and code will serve up a locally hosted video. (WMV format) If someone outside our network (any other IP) visits our web site, they'll see embedded videos hosted on YouTube. Hey guys, First post i have searched the web a lot on this subject and am still confused so i thought id try and get some help from the experts, the following function works great in every browser except IE, the line of code that breaks in IE is highlighted in red. I have read some topics about this not working in IE and saw some workarounds with innerhtml or something but i don't really understand. Can someone please take some time to figure out a fix for this? Code: function displayStream(live_id) { var stream_out = document.getElementById("stream_out"); for (var j = 0; j < stream_out.childNodes.length; j++) { stream_out.removeChild(stream_out.childNodes[j]); } var object = document.createElement("object"); object.setAttribute("height", "475"); object.setAttribute("width", "998"); var param = document.createElement("param"); //param.setAttribute("name", "movie"); param.name = 'movie'; param.setAttribute("value", "http://www.own3d.tv/livestream/" + live_id); object.appendChild(param); var param = document.createElement("param"); param.setAttribute("name", "allowfullscreen"); param.setAttribute("value", "true"); object.appendChild(param); var param = document.createElement("param"); //param.setAttribute("name", "wmode"); param.name = 'wmode'; param.setAttribute("value", "transparent"); object.appendChild(param); var embed = document.createElement('embed'); embed.setAttribute("type", "application/x-shockwave-flash"); embed.setAttribute("src", "http://www.own3d.tv/livestream/" + live_id +";autoplay=true"); embed.setAttribute("allowfullscreen", "true"); embed.setAttribute("wmode", "transparent"); embed.setAttribute("height", "475"); embed.setAttribute("width", "998"); object.appendChild(embed); stream_out.appendChild(object); } Is an iframe the only way to embed a web page? I would like to embed a web page within a email but some users email clients do not support iframes.
HI all , I need to embed videos at runtime using iframe tags , currently am opening them, using urls at runtime using the below javascript...how do i modify the function to embed the iframe in the new window at runtime?? iframe tag eg: iframe width="560" height="315" src="http://www.youtube.com/embed/bx2rhzcIVxo" frameborder="0" allowfullscreen></iframe> Calling point: <body> <form id="form1" runat="server"> <!--A HREF="javascript:makeFrame('http://youtu.be/WPgpb7e7YCA')">Open the Popup Window</A>--> <A HREF="javascriptopUp('http://youtu.be/WPgpb7e7YCA')">Open the Popup Window</A> </form> </body> javascript function: <script type="text/javascript"> <!-- Idea by: Nic Wolfe --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=420,height=315,left = 430,top = 242.5');"); } I'm using VS2008Pro with Master pages. On a child page, I have a modalPopupExtender that calls a panel with an embedded Google video. Everything works great - the popup appears with the video, background greyed. But, when I close the panel, the audio keeps playing in IE 7 & 8. Netscape is fine. I went and tried what Google recommended, but it still continues. Any ideas? Code: '//In child page header <script src="../swfObject/swfobject.js" type="text/javascript"></script> <script type="text/javascript"> var params = { allowScriptAccess: "always" }; var atts = { id: "myytplayer", name: "myytplayer" }; swfobject.embedSWF("http://www.youtube.com/e/GtHDrLngXlc?enablejsapi=1&playerapiid=myytplayer", "myytplayer", "425", "344", "8", null, null, params, atts); function stopVideo() { var playerObj = document.getElementById("myytplayer"); if (playerObj) { playerObj.stopVideo(); playerObj.clearVideo(); } } </script> '//in child page html <asp:ImageButton ID="imgBtnAmanda" runat="server" ImageAlign="Middle" ImageUrl="~/media/quality/devMedAmanda.jpg" /> <asp:Panel ID="pnlAmanda" runat="server" CssClass="modalPopup"> <asp:ImageButton ID="imgBtnCloseAmanda" runat="server" ImageUrl="~/images/icon-x.gif" ImageAlign="Right" /><br /><p align="center"> <div id="myytplayer" name="myytplayer" style="width:425px; height:344px;">You need Flash player 8+ and JavaScript enabled to view this video.</div> <br /><br />Amanda Levesque's performance of "To Dream the Impossible Dream"</p></asp:Panel> <ajaxToolkit:ModalPopupExtender ID="modalAmanda" runat="server" TargetControlID="imgBtnAmanda" PopupControlID="pnlAmanda" BackgroundCssClass="modalBackground" CancelControlID="imgBtnCloseAmanda" OkControlID="imgBtnCloseAmanda" OnOkScript="stopVideo;" onCancelScript="stopVideo;" /> </p> Hello, I am attempting to implement a javascript joystick plugin. The project has a google code page located at: http://code.google.com/p/javascript-joystick/ After installing the plugin, the javascript works flawlessly in IE and FF, however chrome has some issues with executing it. A hosted version of what I am having trouble with can be found at http://www.jimmyblaze.net/joytest/simple.html The issue seems to be with a snippet of code from the main script that attempts to create an object and embed it on the page. The trouble area can be found he Code: try { ctrlFF.type = "application/x-vnd.numfum-joystick"; ctrlFF.width = 0; ctrlFF.height = 0; /* * Before accessing the plug-in's script interface it needs to be * added to the page. If the 'setDevice' call fails, the plug-in * is assumed to either not be installed or not working in this * browser, in which case it is removed in the catch. */ document.body.appendChild(ctrlFF, document.body); if (ctrlFF.setDevice(0) != null) { /* * As with the code for IE, any non-null value is a * success. */ return ctrlFF; } Chrome doesn't seem to support the .setDevice function, as when running the chrome developer tools inspect element tool, I can see it throw an exception at that line, and prompts the user to update java, because it thinks it is out of date. Has anyone run into this issue with chrome and know of a possible fix? Thanks a lot for your time, Legomaniac which is the real difference between: <script> alert('hello'); </script> and <script> function hi() {alert('hello');} </script> thanks in advance makerjoe Hey all, 1) When clicking on a list in an accordion, it should change the quicktime movie playing in a main window area. It works in firefox but not in safari. The variable imgTitle holds the expected output (e.g. '../images/Intro-1.mov'). It changes the src attribute of the embed tag. This change works in Firefox where the new movie plays on click. However, when clicking the list item in safari, nothing happens. 2) There is a problem in firefox as well in that the movie overlays everything else on page, even though it should be behind the text. Positioning would be tedious given that there's many nested elements and I would have to set relative positioning to the entire page. Any reason for this behavior of embed tags? Code: $(".image_thumb ul li ul li").click(function(){ var imgTitle = $(this).find('a').attr("href"); var imgDesc = $(this).find('.block').html(); var imgDescHeight = $(".main_image").find('.block').height(); if ($(this).is(".active")) { return false; } else { console.log(imgTitle); $(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() { $(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 ); $(".main_image embed").attr({ src: imgTitle}); }); } $(".image_thumb ul li ul li").removeClass('active'); $(this).addClass('active'); return false; }) .hover(function(){ $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); }); Thanks for response. I'm working on a technical document that has a glossary section. When I use a technical term, I link to its definition in the glossary then provide a return link to return the user to whence they came. But if I use that same term again, and if I want to link it to the glossary, I need to duplicate the glossary entry in order to provide a return link that returns them to the right place. Is there some way I could link them to the glossary and embed a unique return link in the link to the glossary?
Hi pals, I am really tired in this problem of event keyup. I given same in my keyup function like: $(document).ready(function () { alert("GGG"+parseInt(jQuery.browser.version)); //To display test value working $("#find_text").keyup(function(e) { if(e.which == 13) { alert('Enter key was pressed'); //enter Here alert("FFF"+parseInt(jQuery.browser.version)); //Here got Error } }); }); I got Error : jQuery is not defined alert("FFF"+parseInt(jQuery.browser.version)); I use keycode,which , but no help, It's Work nicely in Chrome Browser but not in FF. Please give a Solution reply ASAP, I am really Tired.The code enter the Condition But that jQuery part make error. Thankfully Anes P.A |