javascript - Adapt a booking portal widget code to use in a mobile app page -
hi trying adapt small booking widget designed websites, use inside mobile app using jquery mobile , html without accompanying button.
(just using rel="external" on link page in jquery mobile) have simple script use on external links social sites (facebook,twitter linkedin,youtube, in fact seems work on of them) links site using hidden div display users relevant profile using site id) code below:
<head> <script type="text/javascript"> window.onload = function() { var url, hdiv = document.getelementbyid("hiddendivid"); if (hdiv != null) url = hdiv.innertext || hdiv.textcontent; if (url) { if (top == self) window.location = url; else top.updatewindowwithcontentsofurl(self, url); } } </script> </head> <body> <div id="hiddendivid" style="display:none">https://www.facebook.com/paulanthonymcgowan </div> </body>
so want use above code works fine, link to/display booking portal widget below designed website button , works fine. simple problem seems button has class of "timify-button" (which can not change or wont work) , dont want use button. here's code that.it opens booking portal customers can view services , book etc:
<head> <script async id="timify" type="text/javascript" src="https://widget.timify.com/js/widget.js" data-position="flexible" ></script> </head> <body> <div style="text-align:center"> <button class="timify-button" data-id="59a27d8fa437750edbb5d245"> book appointment online </button> </div> </body>
there no api , above supplied. have come combine working social page code working timify booking portal widget not work , below. took out data-position="flexible" button not needed there other problems such wrong src file etc.
<head> <script type="text/javascript" async id="timify" src="https://widget.timify.com/js/widget.js"> window.onload = function() { var url, hdiv = document.getelementbyid("hiddendivid"); if (hdiv != null) url = hdiv.innertext || hdiv.textcontent; if (url) { if (top == self) window.location = url; else top.updatewindowwithcontentsofurl(self, url); } } </script> </head> <body> <div id="hiddendivid" style="display:none"> https://widget.timify.com/data-id=59a27d8fa437750edbb5d245 </div> </body>
im not javascript guru appreciated! thanks
Comments
Post a Comment