javascript - Passing two values from child page to parent page -
i have script on child page should pass variable , image parent page.
<script type="text/javascript"> //<![cdata[ function choose(newvalue) { parent.document.getelementbyid(location.search.substring(1)).value = newvalue; } jquery(window).load(function(){ jquery(".td-image-finiture").on("click", function(){ var finitura = jquery(this).children("img").attr("src"); parent.document.getelementbyid(location.search.substring(1)).src = finitura; }); }); //]]> </script>
on parent page have code:
<a class="cboxelement" href="<?php echo mage::geturl('', array('_secure' => mage::app()->getstore()->iscurrentlysecure())) . $_option->getdescription() ?>?options_<?php echo $_option->getid() ?>_text"><?php echo $this->__('choose color') ?></a> <input id="options_<?php echo $_option->getid() ?>_text" /> <img id="options_<?php echo $_option->getid() ?>_img" src=""/>
at moment cannot pass bot values newvalue , finitura, it's 1 @ time, should change?
Comments
Post a Comment