Home > Web Front-end > JS Tutorial > Implementation ideas for taking local paths under js Firefox_javascript skills

Implementation ideas for taking local paths under js Firefox_javascript skills

WBOY
Release: 2016-05-16 17:38:33
Original
1136 people have browsed it
Copy code The code is as follows:

/* Get the full local path under Firefox*/
function getFullPath (obj)
{
if(obj)
{
//ie
if (window.navigator.userAgent.indexOf("MSIE")>=1)
{
obj.select();
return document.selection.createRange().text;
}
//firefox
else if(window.navigator.userAgent.indexOf("Firefox" )>=1)
{
if(obj.files)
{
//return obj.files.item(0).getAsDataURL();
return window.URL. createObjectURL(obj.files[0]);
}
return obj.value;
}
return obj.value;
}
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template