我有一个包含以下代码的
javascript文件grid.js
Preview.prototype = { create : function() { // create Preview structure: this.$title = $( '<h3></h3>' ); this.$description = $( '<p></p>' ); this.$href = $('<div class="showbutton"><form id="myform" method="POST" action="#"><div class="linkbtn02"><a href="#">EVOEGEN</a></div></form></div>' ); this.$details = $( '<div class="og-details"></div>' ).append( this.$title,this.$description,this.$href ); this.$loading = $( '<div class="og-loading"></div>' ); this.$fullimage = $( '<div class="og-fullimg"></div>' ).append( this.$loading ); this.$closePreview = $( '<span class="og-close"></span>' ); this.$previewInner = $( '<div class="og-expander-inner"></div>' ).append( this.$closePreview,this.$fullimage,this.$details ); this.$previewEl = $( '<div class="og-expander"></div>' ).append( this.$previewInner ); // append preview element to the item this.$item.append( this.getEl() ); // set the transitions for the preview and the item if( support ) { this.setTransition(); } },}
但我想为此.$href属性使用动态值.
它会是这样的
this.$href = $('<div class="showbutton"><?PHP woocommerce_quantity_input(); ?></div>' );
有人能告诉我如何使用PHP内部?
请注意,我有一个foreach循环.因此每个循环的行不同.