|
Hi friends,
how can i download a wav file on clicking a HTML Download Link?...
Note: without zipping that file
Thanks in advance
|
|
|
|
|
Please clarify your question.
Do you want to create a link?
Is this what you are looking for?
<a href="yourfilename.wav">Click here to download</a>
If it's not, please post your question with more details.
Regards
tech
|
|
|
|
|
Hi msn92,
Actually, i am looking to download wav file when the link gets clicked..
In the above code, what u have sent..if i click the link, wav file starts playing instead of getting download!...By zipping wav file i can download,but that is not the required task...The aim is, i should download wav file by clicking a link..which should be done in htmlpage but not in aspx page and not by zipping wav file.......Please guide.
i will be waiting for your reply...
Thanks,,
|
|
|
|
|
<<a href="Untitled.wav">Download</a>
The code above worked in Internet Explorer (v8) and Firefox (v3.5). They both DID let me download.
I don't know why it's not working in your case. What browser are you using?
|
|
|
|
|
i have used select tag in html and in that tag i have added country names.
when i select country india or something else then it should show me the states in another select tag related to that country.and i want to store these in database mysql in asp please reply..
|
|
|
|
|
Are you posting the same question twice?
|
|
|
|
|
I've a text file with alphanumeric information... Now I want to parse the file using javascript
Text File contents looks like below:
File file1 111 1.008665 0.249284
Action 1.008611 0.249679 10
Action 1.008479 0.250069 10
EndFile
File file2 112 1.008322 0.248816
Action 1.008443 0.248858 10
Action 1.008555 0.249284 10
EndFile
.
.
.
In the above text file I want to save each file tag information in a seperate data structure so I can use them ..
Can you plz help me in this senario. Thanks
|
|
|
|
|
I don;t think you can do that directly with javascript - unless you put the file contents in a textarea - as js does not have access to files outside of the browser - so you may as well do it with a server side language (PHP/ASP)
|
|
|
|
|
You can use Regular Expressions.
Example:
<script type="text/javascript">
var source;
var re=new RegExp(/File([^\^]*?)EndFile/g);
var matches=source.match(re);
if (matches!=null)
{
for (i=0;i<matches.length;i++){
alert("Match #"+i+" is "+matches[i]);
}
}
</script>
Hope that helps.
|
|
|
|
|
when i create sign-up form i select the country india in combobox1
but when i select country india in combobox1 then it should show me
the states in combo2 related to that country only?
please tell me the code in detail?
|
|
|
|
|
So you need to apply a filter to the content of combobox2. Without knowing anything about how it is populated or even what language you are using thats all I can tell you.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi
I have a URL in html format.
For example:
http://wutever.com/
And I want to convert it to:
http://wutever.com/
How can I do that?
Is there any function like encodeURI() ?
Any help would be greatly appreciated.
|
|
|
|
|
PHP func is htmlentities i think
|
|
|
|
|
Marc Firth, thank you for your reply.
I want to do it in JavaScript Is there equivalent function in JavaScript?
Or do I have to write my own?
|
|
|
|
|
|
dear all,
i really want to know the way to get reference to an iframe object in my asp page. i want to store src of this iframe in session object. can anyone tells me how to do so?
thanks, if u can give me the answer.
|
|
|
|
|
<script>
var mysrc = document.getElementById('myframe').src;
//jquery
$.get("store_in_session.asp", { src: mysrc} );
</script>
<iframe id="myframe" src="x.php"></iframe>
That sends the data to a page where you can store the src in your session variable.
You need to code that page yourself in asp but in php it would be something like:
<?php
session_start();
$_SESSION['mysrc'] = $_GET['src'];
?>
|
|
|
|
|
Hi,
I am looking for an easy way to transfer a javascript array from one page to another. The page that it is being transferred to will be either POSTed or GETted (hmm, that didn't quite work how I wanted it to) from the previous page.
One way that I have thought of is converting it to a string and sending it over GET, and I found this[^], but I have a few concerns with it. It is firstly a two dimensional array, so I would need to convert that to a string and then convert it back at the other end, the second is security (if it is sent over GET, even on an SSL connection, URL will probably still be visible to someone eves dropping), and third is length (the string could get very long very quickly, and there could become problems if the URL gets too long and messy). That said, I could also devise a way using a hidden form object to send it over POST, so I would probably end up doing it that way.
My question is basically, should I convert it to a string and then parse it back into an array later on, or is there an easier way that I am missing?
Thanks heaps, Josh.
|
|
|
|
|
if security is an issue you can use encryption to encrypt the array. you could look into using AJAX post as well. jQuery is an excellent extension for helping with this and great for beginnners (those who havent delt with creating httprequests before).
I know in PHP you can serialize the array - so maybe there's an equivalent function in javascript?
|
|
|
|
|
Thanks for the reply.
What I am doing as a solution is turning the array into one long string, using AJAX to store it in a PHP session, moving to another page and then having PHP process it when it restores the session.
Basically, the code I am using to turn the array into a string is:
function convertTwoDimensionArrayToString(arrayToConvert) {
arrayAsString = "7"
for (i in arrayToConvert) {
for (j in arrayToConvert[i]) {
arrayAsString += "%%" + arrayToConvert[i][j];
}
}
return arrayAsString;
}
Because it is a two dimensional array, I need to run the for loop twice, but that said, it will put everything into one long, string (obviously). To turn it back into a two dimensional array, I have used the first index (0) to define the array length so the second dimension in every array in this case has a length of 7. I don't know if I explained my logic that well, but it makes sense to me
This will ONLY work if the second dimension in the array is always the same length (and in my case, it ALWAYS will be, there would be a major flaw in the program if there wasn't). If the second dimension in the array varies in length, I would change the code to separate the different index's of the second array differently to how I would separate the different index's of the first array.
It definitely does work (and it gives me a way to get the array from javascript to php without too problems as well!), but it isn't the most elegant solution. Just thought I would share my solution with others!
|
|
|
|
|
You could send the items of data individually using AJAX if, for example, it is entered into a form and have PHP convert it into the array.
Also, if the amount of data is too long you could encrypt it and store it as an encrypted cookie - so long as it doesn't affect usability if the cookie is deleted (You can pass cookies between javascript and PHP).
Joshua Henderson wrote:
It definitely does work (and it gives me a way to get the array from javascript to php without too problems as well!), but it isn't the most elegant solution.
Depends on you definition of "elegant solution", development speed or short fancy code. Your code looks fine to me anyway. Clean, readable and concise.
|
|
|
|
|
Hi,
I have a web based application writing with asp.net and vb.net,it sends and recieves requests between users and helpdesks,I want check the database and if a new request has already been added to database, show an alert to the helpdesk,I think I should use a conditional update panel and set a timer in that and check for incoming request,but I dont know how to show alert after that!!!
I will be thankfull if anybody could help me..
with regards
modified on Tuesday, August 18, 2009 10:03 AM
|
|
|
|
|
hi all
all what i want to do is to show a confirmation message the user when he try to close the page, if he want to close the page i have some code to execute, but if he decide to stay i want to keep the window open.
i used the following function but it have one issue: when the user click cancel the page get closed
so can you help me and tell what i did wrong
am using IE7
window.onbeforeunload = HandleOnClose;
function HandleOnClose(event)
{
if(currentElement == "" || (!(currentElement.getAttribute("tag")=="DonotCallSaveonLoad")))
{
if(divTimer.style.display != 'none')
{
var objWarningMsg = document.getElementById("<%=hdnCloseWOWarning.ClientID %>").value;
if(objWarningMsg == "False")
{
var objconfirm = confirm("you wont be able to open this quiz again, continue?")
if(objconfirm == true)
{
FunctiontoCallSaveData();
}
else
{
}
}
else
{
FunctiontoCallSaveData();
}
}
else
{
FunctiontoCallSaveData();
}
}
}
|
|
|
|
|
if(objconfirm == true){
FunctiontoCallSaveData();
} else {
return false;
}
I think
|
|
|
|
|
thank but not working
all what it did it gave me another popup with ok and cancel
this should work with normal end users but mine are way below that level 
|
|
|
|