Friday, 28 July 2017

Creating an Azure SQL Server DB and Connecting via Management Studio


To create a new SQL Server database instance in Azure follow these steps:

1. Click the SQL databases instance





2. Select Add and enter all database details




You have now created your first Azure SQL Server database. Now in order to connect for Management studio so you can edit the database follow the following steps


3. Click on the database you have created and on the top select Set server firewall



Add Client IP address and set allow access to Azure Services to ON



4. Finally get the details to connect to the server by going to the properties of the database


5. Enter these details with the password you have set into management studio and you should now be able to connect.




Thursday, 20 July 2017

Resize iFrame dynamically based on content


iFrame will resize dynamically for content on the same domain.

 

 

<style>.woocommerce-product-gallery{ opacity: 1 !important; }</style>

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'></script>
<script type='text/javascript'>
   
    $(function(){
   
        var iFrames = $('iframe');
     
            function iResize() {
           
                    for (var i = 0, j = iFrames.length; i < j; i++) {
                      iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';}
                }
               
                if ($.browser.safari || $.browser.opera) {
               
                   iFrames.load(function(){
                       setTimeout(iResize, 0);
               });
           
                   for (var i = 0, j = iFrames.length; i < j; i++) {
                                var iSource = iFrames[i].src;
                                iFrames[i].src = '';
                                iFrames[i].src = iSource;
               }
              
                } else {
                   iFrames.load(function() {
                       this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
                   });
                }
       
        });

</script>

 

 

 

<style>.woocommerce-product-gallery{ opacity: 1 !important; }</style>

<iframe src="content.html" class="iframe" scrolling="no" frameborder="0"></iframe>