js中变量可以存图片么 var img = "images/pic.jpg";这就是存路径了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以..//第一种方法function img(){ var img = new Image([width], [height]); img.src = [path]; // 可以是绝对的也可以是相对的. return img;}//第二种方法function img(){ var img = document.createElement("img"); img.setAttribute("width", [width]); img.setAttribute("height", [height]); img.setAttribute("src", [path]); // 可以是绝对的也可以是相对的. return img;}//第三种方法function img(){ return document.getElementById([id]);}//第四种方法function img(){ return document.images[index];}var a = img(); 请高手看看我这段代码错在哪里? ExtJS怎样取得组件对象 怎么在同一个页面定义两个enter属性~~ javascript cookies 代码问题 想要一个效果,某页面上按钮为添加,点下去打开新窗口,数据添加完毕按完成,成功则关闭新窗口,弹出窗口得页面会自动刷新下 急! 怪事年年有! JAVASCRIPT的replace函数有那些参数?为什么replace(str,"'","''")只能替换一次? 购物车的设计 求富文本用js过滤部分标签但保留文本内容代码! JSP乱码问题 怎样得到frame的height和width
//第一种方法
function img()
{
var img = new Image([width], [height]);
img.src = [path]; // 可以是绝对的也可以是相对的.
return img;
}
//第二种方法
function img()
{
var img = document.createElement("img");
img.setAttribute("width", [width]);
img.setAttribute("height", [height]);
img.setAttribute("src", [path]); // 可以是绝对的也可以是相对的.
return img;
}
//第三种方法
function img()
{
return document.getElementById([id]);
}
//第四种方法
function img()
{
return document.images[index];
}var a = img();