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
WBOYOriginal
2016-05-16 17:38:331162browse
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;
}
}
Statement:
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