I'm trying to grab a variable from a URL and dynamically embed it into HTML code. So for instance, if I own the site test.com and I enterideo=bunny.mp4&height=720&width=480",I want the returned page to be an embedded video of bunny.mp4 at the height and width specified. I know the embed code, I just need to know how to parse the URL and write it inside of the HTML.
I'm trying to set up a system similar to Google AdSense that allows other websites to display some HTML content from my site on theirs. I've looked at the show_ads.js file Google uses to display Ads but to be honest I've not found it easy to decipher. I've also read that using a <script> tag to load a JavaScript file from my site is simpler than trying to do do this with an AJAX request. it discusses returning JSON rather than HTML.
BTW I know I could use an iframe to achieve something similar but this won't give me the result I need because the content coming from my site will contain a link back to my site and I want the link to be registered as an inbound link to my site for SEO reasons.
GOAL: My end goal is to send a web page (single file) as an attachment (not embedded) via email to any of the main email clients (Eudora, Outlook, etc). Users see a single web page attachment and either double click or "view in browser" in order to view it. (It is an attachment after all).... When they DO open Internet Explorer (is all I need, not netscape), a single image appears with some appended text.
CHALLENGE: My challenge is: I don't believe I can send more than one file via email because of the potential renaming of currently-existing files (i.e. the image gets renamed and the webpage points to an older picture, because the web page was certainly not updated). Also, some email clients, like Eudora, like to attach the whole path name of an attachment as the file name (so that C: empabc.jpg becomes CTEMPABC.JPG and the web page no longer knows what to point to depending upon the email clients).
METHOD OF OPERATION: So I thought, perhaps there's a way to embed the image DATA into the html itself and on "onLoad" or some other method, save the temp file (whatever.jpg) and rewrite the html to point to the IMG file.
THE QUESTION: How can I do that? (or another way to accomplish the same).
REQUIREMENTS: Internet Explorer 5 or 5.5 and better, as I use a plugin which requires IE, not an email client's internal browser, and *not* netscape. Windows 98se or better.
Im new to JS. Im having a problem with special character (im from Denmark where we useWhen embeded the text doesnt include the special characters. I know why but I dont know how to resolve it.My HTML looks like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
I want to include a link in the alert method.I tried this
alert("Please enable your java to experience this enhanced page." + '<a href="http://www.java.com/en/download/index.jsp" target="_blank">Free Download Java</a>');
But this will not made a link it shows all as it is. How can i made a link in alert.
what i am trying to do is really simple; however, i am still new at code, and i have google -earched endlessly and have not found the answer to this one.All i want to do is embed a flash file into my web page. The user would click on a button and the animation plays once, and stops.In my mind it should just be a javascript function that allows the embeded flash file to play when the link is clicked!
I have alot of home videos I want to put on my website, and it seems that the easiest way to do it would be to embed it onto my website using HTML script. Problem is, I have no clue how to convert in into HTML scrip
The scenario would be something like checking if an element fulfills some complex conditions, something like if(myElement.is('div.someClass[someAttribute], td.someOtherClass[someAttribute]')) ... . Is there a way to parse that string only once, maybe create some sort of "compiled" version of the check, cache it, then give it to is ? Or does jQuery cache the string after parsing it once so I don't have to do anything?
Lets say you have a 1000 line javascript file which is linked to an everyday html file. The browser is set, by default, cache the linked javascript file (after downloading and interpreting it).
But once it's cached and put into a temp directory on the client's computer, is the cached file in an already parsed format? Or something relative? Or is it in the same format as it was on the server-side? This would mean that the .js file is parsed each time the exact same way (as long as the file itself is not changed, deleted, or renewed on the server-side).
how to remove an XML file that I have parsed. My goal is to be able to add n number of XML files and have the ability to remove a parsed file. So, my question is, how can I remove the file I have just parsed? Code:
Well, this is acutally a couple different scripts. First is the custom date object myDate which retrieves pretty much every value that you'd need from a date and sets it as a property. If no argument is supplied, the current time and date is used. If you do supply an argument, you can send an existing javascript Date object, or a string that is compatible with declaring a normal javascript Date object.
The 2nd part of this script is the method getDate (and some accompanying String methods) that allow you to retrieve the date as a string by passing it a format string just like the PHP date() (http://www.php.net/manual/en/function.date.php) function accepts. The code posted below includes sufficient (I think) examples to help you understand what is going on. You will notice that I didn't duplicate EVERY code over from PHP, and a few are slightly different. Those that I left out I felt weren't very necessary, or I didn't feel like doing the algorithm for them :D.
Both myDateObj.getDate() and PHP's date() allow you to include text into the string that you don't want parsed, but each handles it differently. In PHP, you need to escape characters normally with a backslash. For getDate you need to proceed each character with a pipe "|". So, instead of$dateStr = date("Day z");as it would be in PHP, you would usevar d = new myDate(); var dateStr = d.getDate("D|a|y| z");There are more examples of how this works below.
Note: There is also a nice arrayReplace() method for strings that is handy for doing multiple replace() operations all at once, so I guess this is really like 3 handy scripts ;)
/*** First Part of Script, the custom date object ***/
function myDate(dateStr) { if (typeof dateStr != 'undefined') { var d = new Date(dateStr); this.dateString = dateStr; } else if (typeof dateStr == 'object') var d = dateStr; else var d = new Date(); var months = ['January','February','March','April','May','June','July','August','September','October','November',' December']; var weekDays = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; var monthDays = [31,28,31,30,31,30,31,31,30,31,30,31];
function leadingZero(num) { return (num < 10) ? "0" + num : num.toString(); } }
myDate.prototype.getDayOfYear = function() { var total = 0; var monthDays = [31,28,31,30,31,30,31,31,30,31,30,31]; if (this.leap) monthDays[1]++; for (var i=0; i<this.mnth; total += monthDays[i++]) {} total += this.date; return total; }
/*** Second part of script, the PHP-like parsed output ***/
String.prototype.arrayReplace = function(arrP, arrR) { var p, s = this; for (var i=0; i<arrP.length; i++) { var flags = arrP[i].substring(arrP[i].lastIndexOf("/")+1); var regex = arrP[i].substring(1,arrP[i].lastIndexOf("/")); p = new RegExp(regex, flags); s = s.replace(p, arrR[i]); } return s; }
String.prototype.delimit = function(char) { var s = ""; for (var i=0; i<this.length; i++) { s += this.charAt(i) + char; } return s; }
</script> </head>
<body>
<script type="text/javascript">
/*** Example using current date/time ***/
var md1 = new myDate(); document.write(md1.getDate("l jS of F Y h:i:s A")+"<br>"); document.write(md1.getDate("T|o|d|a|y| i|s| m.d.y")+"<br>"); document.write(md1.getDate("D M j G:i:s Y")+"<br>"); document.write("It " + (md1.leap?"is":"is not") + " a leap year<br>"); document.write("The unix epoch occurred " + md1.epochS + " seconds ago"); document.write("<hr>");
/*** Example using javascript Date object as argument ***/
var d1 = new Date(2000, 01, 02, 15, 15, 15); var md2 = new myDate(d1); document.write(md2.getDate("l jS of F Y h:i:s A")+"<br>"); document.write(md2.getDate("T|o|d|a|y| i|s| m.d.y")+"<br>"); document.write(md2.getDate("D M j G:i:s Y")+"<br>"); document.write("It " + (md2.leap?"is":"is not") + " a leap year<br>"); document.write("The unix epoch occurred " + md2.epochS + " seconds ago"); document.write("<hr>");
/*** Example using Date object compatible string as argument ***/
var md3 = new myDate("December 10, 1978 12:23:00"); document.write(md3.getDate("l jS of F Y h:i:s A")+"<br>"); document.write(md3.getDate("T|o|d|a|y| i|s| m.d.y")+"<br>"); document.write(md3.getDate("D M j G:i:s Y")+"<br>"); document.write("It " + (md3.leap?"is":"is not") + " a leap year<br>"); document.write("The unix epoch occurred " + md3.epochS + " seconds ago"); </script> </body> </html>
I have a html file that I want to load, loop through the json data and for each json entry I want to add a new block of the html and insert the json data into the matching div/class of the html. json looks like this:
So for each json entry of name/age, I want to insert that into the html, and then add another row, until all json data has been fetched. After this I want to insert all of this into #box, which is just a divthat should contain that html. Looping like this obviously does not work, since I just keep replacing the same html through the loop.
I need to embed a mov file in a HTML file, the problem I found is that the Quicktime player is window mode and I need it windowless, I check not found a property to set it windowless, for windows media player exist the following property:
<PARAM NAME='windowlessVideo' VALUE='True'>
The problem is that I have floating elements that appear behind the quick time player, I was wandering if there is a way to set it windowless,
how can i get data ( a div) from an html page and put it in a different html page in a certain place? i can't get it to work !! i need something else i think!! i need it to load when i click on a link or a text am i missing something?? i've put the code in a click function but it doesn,t work...
$('#mood').html always contains the value of the values food_rate and tax_rate had before I loaded the new values in. (Before Line 1 and 2 happen)I already red, about event bubbling and event delegation, but the html-elements fax_rate and food_rate exist from the beginning, and only their innerHTML does change.
I stumbled across jQuery while during a search for my project that involves parsing and extracting content from HTML pages. I have a collection of xpath strings that identifies the data I would like to extract. Wondering if I could use jQuery for this purpose.
I have a table that displays a list of groups. You can add, modify, or remove the group. I have three functions in my JS:
[Code]...
Using AJAX, PHP, and jQuery, when I add a group, it posts to an "addgroup.php" file, and then returns that data in JSON format, and I then tell jQuery to display that data in HTML. Here's the problem now... The table does not render properly. There is no padding/margins. Even worse, if I Add a group, and then click the "X" to delete the group (without refreshing the page), the data posts, and returns (i get a response in my console confirming the removal), but the entry that I just added does not disappear (as it should) unless I refresh the page. When I add a group, and then view my page source and inspect the element, all of the appropriate HTML is there, but it just doesn't seem to be rendering right.
I want to set a chek box, and it will checked if data found from database and non checked if data is not found from data base ,yes this is i know but think is that ,if it checked it show some html data in another div like <div id="name"></div>
I have a textbox and button in html, and when something is fill in the textbox, i want to pass the value of the textbox to ajax, data: '{"name": theName}', I couldn't seems to get it to work.
Of couse when i use string value, it works just perfectly for example: data: '{"name": "Joe"}',
I built a pretty simple Ajax request which needs to send some data to the server and put the resulting HTML in a div. Unforunately, I need to POST the data. I used .post() and it worked fine ... *on Chrome and Opera!* ... on Firefox no data gets posted even though firebug shows the data in it's console. I ended up building the longest possible request, just to try all the options. No luck. As soon as I POST anything, Firefox won't receive the data. If this was a Firefox issue, wouldn't I read about it everywhere? What's wrong?
I have a cgi script with an HTML form that processes DNA sequences from a user, aligning them against millions of other DNA sequences. That takes a while, so I want to display a waiting message while the query is being processed. My page is here :I am not sure what I am doing wrong, most of the time the message appears so briefly you can barely see it (if you're lucky it appears nicely but quickly disappears). The page gets reloaded with the results below the form, and it seems that both processes (blockUI and the program itself) are conflictingTo test the page, you could paste the following in the text area