草庐IT

data-attributes

全部标签

javascript - "Bad value for attribute src on element img: Must be non-empty", 用于动态生成的 img src

我有一个带有图像slider的网站。当幻灯片进入View以加快页面加载速度时,我将一些图像标签留空,因为图像会加载。图片标签定义如下:我正在做的是在幻灯片功能上,我使用jQuery动画将src更改为data-src。slider效果很好。我的问题是当我尝试在w3cvalidationtool中验证它时它给出了以下错误:Line131,Column179:Badvalueforattributesrconelementimg:Mustbenon-empty....data-src="img/portfolio-desktop1-small.jpg"src=""alt=""/>Syntax

javascript - "Bad value for attribute src on element img: Must be non-empty", 用于动态生成的 img src

我有一个带有图像slider的网站。当幻灯片进入View以加快页面加载速度时,我将一些图像标签留空,因为图像会加载。图片标签定义如下:我正在做的是在幻灯片功能上,我使用jQuery动画将src更改为data-src。slider效果很好。我的问题是当我尝试在w3cvalidationtool中验证它时它给出了以下错误:Line131,Column179:Badvalueforattributesrconelementimg:Mustbenon-empty....data-src="img/portfolio-desktop1-small.jpg"src=""alt=""/>Syntax

html 5 data-* 语法不能绑定(bind) Angular 2 中的值?

我有一个这样的对象数组Heros=[{heroName:"card1",heroType:"type1",heroHtml:"card1"},{heroName:"card2",heroType:"type2",heroHtml:"card2"}]我想像这样在我的html页面中显示它可以看到一个Plunker在这里。为什么data-component-type取不到正确的值?如果禁止或不推荐这样做,还有什么解决方案可用于将值绑定(bind)到html5自定义属性? 最佳答案 那是因为data-hero-type不是div的属性,而是

html 5 data-* 语法不能绑定(bind) Angular 2 中的值?

我有一个这样的对象数组Heros=[{heroName:"card1",heroType:"type1",heroHtml:"card1"},{heroName:"card2",heroType:"type2",heroHtml:"card2"}]我想像这样在我的html页面中显示它可以看到一个Plunker在这里。为什么data-component-type取不到正确的值?如果禁止或不推荐这样做,还有什么解决方案可用于将值绑定(bind)到html5自定义属性? 最佳答案 那是因为data-hero-type不是div的属性,而是

html - 错误 : Element input with attribute type whose value is button must have non-empty attribute value

我正在使用joomla2.5.8和virtuemart2.0.6。在w3验证后,我得到以下错误:Elementinputwithattributetypewhosevalueisbuttonmusthavenon-emptyattributevalue.Elementinputwithattributetypewhosevalueisbuttonmusthavenon-emptyattributevalue. 最佳答案 您必须为您的按钮提供一个值属性。如果您不想在其中显示任何内容,请使用value=" "

html - 错误 : Element input with attribute type whose value is button must have non-empty attribute value

我正在使用joomla2.5.8和virtuemart2.0.6。在w3验证后,我得到以下错误:Elementinputwithattributetypewhosevalueisbuttonmusthavenon-emptyattributevalue.Elementinputwithattributetypewhosevalueisbuttonmusthavenon-emptyattributevalue. 最佳答案 您必须为您的按钮提供一个值属性。如果您不想在其中显示任何内容,请使用value=" "

javascript - 如何在ie 7中获取 "data"属性?

我在IE7中使用“数据”属性,但我不知道如何获取它的值。jQuery可以帮助我吗?我有这个window.event.srcElement.getAttribute('data-pk')当然不行。编辑:for(i=0;ihtml 最佳答案 jQuery可以帮助...数据属性与jQuery中的data()函数一起工作。$(srcElement).data('pk');您可以将它与任何数据属性一起使用,例如,如果您有:您可以通过以下方式获取数据:$('#DivId').data('something');$('#DivId').data(

javascript - 如何在ie 7中获取 "data"属性?

我在IE7中使用“数据”属性,但我不知道如何获取它的值。jQuery可以帮助我吗?我有这个window.event.srcElement.getAttribute('data-pk')当然不行。编辑:for(i=0;ihtml 最佳答案 jQuery可以帮助...数据属性与jQuery中的data()函数一起工作。$(srcElement).data('pk');您可以将它与任何数据属性一起使用,例如,如果您有:您可以通过以下方式获取数据:$('#DivId').data('something');$('#DivId').data(

javascript - 未捕获的安全错误 : Failed to execute 'getImageData' on 'CanvasRenderingContext2D' : The canvas has been tainted by cross-origin data

我在Chrome和Opera浏览器中遇到这个错误:UncaughtSecurityError:Failedtoexecute'getImageData'on'CanvasRenderingContext2D':Thecanvashasbeentaintedbycross-origindata.该代码在InternetExplorer、MozillaFirefox和Safari中运行良好。但我需要在Chrome和Opera中修复它。请帮我找到解决此问题的方法?我在这一行收到这个错误imgData=ctx.getImageData(x1,y1,w,h); 最佳答

javascript - 未捕获的安全错误 : Failed to execute 'getImageData' on 'CanvasRenderingContext2D' : The canvas has been tainted by cross-origin data

我在Chrome和Opera浏览器中遇到这个错误:UncaughtSecurityError:Failedtoexecute'getImageData'on'CanvasRenderingContext2D':Thecanvashasbeentaintedbycross-origindata.该代码在InternetExplorer、MozillaFirefox和Safari中运行良好。但我需要在Chrome和Opera中修复它。请帮我找到解决此问题的方法?我在这一行收到这个错误imgData=ctx.getImageData(x1,y1,w,h); 最佳答