Dynamically add ckeditor textarea using javascript

CKEditor textarea add dynamic using javascript

CKEditor textarea add dynamic using javascript

Are you looking for the solution of the following questions than here is the solution to add dynamic CKEditor textarea.

How to add CKEditor Textarea runtime using javascript?
How to add CKEditor Textarea Dynamically using javascript?
How to add CKEditor Textarea runtime using jQuery?
How to add CKEditor Textarea Dynamically using jQuery?
CKEditor textarea add dynamic using javascript.

When you are working with CMS or webpage where you need the functionality to do “Add More” which will add new textbox, checkbox, radio button or select dropdown than you can do it easily. Even you can add simple textarea as well with normal code but when you need to insert CKEditor at runtime than may be you stuck.

I am here to help you, Simple code to add CKEditor textarea dynamically at runtime without refresh the page. You can use this code to add CKEditor textarea at runtime.

 
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
 <script type="text/javascript" src="../includes/ckeditor/ckeditor.js"></script>
 <script src="../includes/ckeditor/adapters/jquery.js"></script>
 
 var counter = 1;
 
 function AddMoreTextEditor()
 {
   var newtxtname = 'txtNew' + counter;
   var newTextArea = '<textarea rows="10" cols="50" class="ckeditor" name="' + newtxtname + '" id="' + newtxtname + '"></textarea>';
   $("#divid").html(newTextArea);
   $('textarea#' + newtxtname).ckeditor();
   counter++;
 }

please set “#divid” which is the placeholder here. You need to set the path of “ckeditor.js” and “jquery.js” as per your project. In above javascript code there is a function named “AddMoreTextEditor” to add new CKEditor textarea. Call this function from your “Add More” Link.

Please let me know if you need more help.

Cakephp hasMany and belongsTo with example

CakePHP offers excellent way for associations for linking models. There are 4 types of relationship in CakePHP which are as below.

1) hasone is used for One to one relationship.
2) hasMany is used for one to many relationships.
3) belongsTo is used for many to one relationship.
4) hasAndBelongsToMany is used for many to many relationship.

Cakephp Associations Linking Models  Relationship Types with example

Cakephp Associations Linking Models Relationship Types with example

Have a look on the example and explanation of hasMany and belongsTo relationship.

Example

This example is useful to understand Category and Product relationship in cakephp.

Category table have two fields “id” and “CategoryName”.

Product table have three fields “id”, “category_id” and “ProductName”. You can add as many fields as you want in product table but I took only 3 to explain the relationship with category.

 
class Category extends AppModel {
    public $order = "CategoryName";
 
    public $hasMany = array(
        'Product' => array(
            'className' => 'Product',
            'foreignKey' => 'category _id',
            'dependent' => true
        )
    );
}

In the Category model class, each category have either one or more than one products. when you are doing association like this than you have to use “hadMany” relationship in CakePHP. I define that “category_id” is a foreignkey in product table. Example of CakePHP “hasMany” relationship type.

 
class Product extends AppModel {
    public $order = "ProductName";        
 
    public $belongsTo = array(
            'Category' => array(
                'className' => ' Category ',
                'foreignKey' => 'category_id'
            )
        );
}

In the Product model class, each product belongs to any one category. I define that “category_id” is a foreignkey in product table. Example of CakePHP “belongsTo” relationship type.

Many developer confuse here and try to use CakePHP “hasOne” relationship type in product model class which will not work at all. I hope that, this example is useful to clear your confusion about the CakePHP relationship types.

SSL Server Supports Weak Encryption for SSLv3, TLSv1 in PCI scans results

SSL Server Supports Weak Encryption for SSLv3, TLSv1 in PCI scans results

SSL Server Supports Weak Encryption for SSLv3, TLSv1 in PCI scans results

Recently, one of my clients ran PCI Scan for his web-site which is hosted on the LAMP environment. He find the below issues in the scans result page.

1) SSL Server Supports Weak Encryption for SSLv3, TLSv1
2) SSL Server Supports CBC Ciphers for SSLv3, TLSv1
3) SSL Server Supports Weak MAC Algorithm for SSLv3, TLSv1

[Resolved]: You need to do some configuration in https.conf file. Please add below rule in your https.conf file and restart apache will fix SSL Server Supports Weak Encryption for SSLv3, TLSv1 issue.

[Resolved]: You need to disable cipher suites using CBC ciphers to fix SSL Server Supports CBC Ciphers for SSLv3, TLSv1 issue.

[Resolved]: You need to disable cipher suites using MD5 based MAC algorithms to fix SSL Server Supports Weak MAC Algorithm for SSLv3, TLSv1 issue.

How to configure DNS to point to a static or dynamic IP address

configure DNS to point to a static or dynamic IP address

configure DNS to point to a static or dynamic IP address

Now, everything is available on internet and you can grow your business using internet marketing. To grow your business, you have to develop your own web-site and apps which will be helpful in internet marketing. You need domain and web server to host your web-site. I am working as a freelance web developer because of that I have knowledge of domain and hosting. Many times my clients ask me that they have their own static IP address. can my computer become a server for my own web-site?

Question

What is my name server if I use my pc as a server using static IP address?
How to configure DNS to point to a dynamic IP address?

Answer

You can use your IP address in place of Name servers. Nameservers are hosted service, if you know than you can install a DNS server in your computer. IIS or Apache server doesn’t have anything to do with DNS.

It is not required that you have a static IP address to act your computer as a web-server. You can create web server even your IP address is not static but dynamic. You can use ddclient services which will update the DDNS server when your IP is dynamic IP address.

My domain points to two different IP addresses after DNS nameserves change

Domain points to two different IP addresses after DNS  change

Domain points to two different IP addresses after DNS change

One of my friends faces the issue where his domain name (testing .com) pointing to two different IP addresses once he changed his DNS nameserves.
He told me that his domain (testing.com) points to IP address xxx-xxx-xxx-xxx before he changed his DNS nameservers
Then he changed his domain (testing.com) DNS nameserves and the new IP address is xxx-xxx-xxx-xxx.

After some time he use ping command to check the reply and he was wondering because he got reply from Both IP addresses. When he visit web-site url from browser than facing issue in data loading. Sometimes its loads web-page and sometimes doesn’t load web-page.

If you are facing the same issue than no need to worry, this issue resolved automatically. Let me explain why these issues arise?

DNS resolvers receive lots of requests daily and because of that they DNS resolver cache requests. Your domain points to first IP address before you change the DNS which is in cache. When you change your DNS nameservers than its points to new IP address but it doesn’t clear cache immediately. Existing cache points to old IP address, this is the reason why its points to both IP addresses.

Once the cache has been cleared than its will points to new IP address only.

How the domain name and domain DNS servers work and not working

How the domain name and DNS nameservers work

How the domain name and DNS nameservers work

I know many people who are not technical have lots of question about domain name and DNS name servers.

How the domains work?

How to park my domain?

What is nameservers?

What is DNS?

You are registering your domain on godaddy or any web-site which allowed you to purchase domain name. Once you purchase domain, you need to park your domain. To park domain you need to setup the DNS nameservers.

You get your DNS nameserves from your hosting provider where you host your web-site. This is the way to linkup your domain with your web-site pages.

Now, let’s see how it works when user type domain name in browser.

  • Computer send request to the ISP (Internet service provider) resolver to find out the IP Address of your domain name.
  • ISP (Internet service provider) resolver send request to the “.” Name server.
  • Once “.” Name server receive request than response back to ISP (Internet service provider) resolver to try using the com. Nameserver.
  • Now, after getting response ISP (Internet service provider) resolver send request to com. Nameserver.
  • The com. Nameserver look in to glue records for your domain and send the DNS nameservers information to your ISP (Internet service provider) resolver.
  • Now, ISP (Internet service provider) resolvers have the DNS nameserver for your domain, so send request for the web-page of your domain.
  • ISP (Internet service provider) resolvers send web-page to your computer browser to display.

 

 

As you change your DNS nameservers record in your domain account, that domain points to the hosting server. You need to understand domain name and web hosting before you plan to start your own web-site.

Google launch driverless cars to California State in USA

Google will launch driverless cars in California State. First driverless cars will be shown on the street of California City. Google confirm that this car are self-driving cars and drive comfortably on the freeways. In the city there are lots of big challenges for Google’s driverless car, because there are lots of pedestrian, bicyclists and most challenging is blind zone.

Google launch driverless cars to California State in USA

Google launch driverless cars to California State in USA

Google says that new self-driving smart car can handle lots of urban situation but they are working to make car’s computer more batter to handle the walker, motorist which includes bikes and bicyclists and blind zone of the car.

Google X lab’s project director Chris Urmson said “We are growing more optimistic that we are heading toward an achievable goal a vehicle that operates fully without human intervention”.

Google will launch this driverless car for public in 2017. On initial stage google prefer that human drivers would be ready to take control of the driveless car when car computer is not able to control the situation. This driverless car will be awesome for long drive on freeways where you can read, eat, play a game on computer, watch movies or TV shows and sleep as well. Google says that one day car computer will work safer than human driver. Once this driverless smart car will launched that may be its reduce the accident made by human’s mistake.

Google and car makers working on this smart project for driverless car, where sensors fitted in this car give the 3D maps surrounding the car to the google software. Google software use this 3D map and detect the pedestrians, motorist including bikes and bicycles, moving vehicles and other objects like curbs, parked car, walk way and signs. Google software is also read signals, stop sign and school crossing guards.

Source: The Hindu
Image Source: The Hindu

Google, Apple announce plans to enter smart home market

The way you have been operating your home appliances, lights and security systems is set to change if bids by Google and Apple to enter the smart home business come to fruition. In a couple of weeks, be prepared to discover how you can automate various systems and appliances in your home.

According to credible reports, their is a planned takeover of Dropcam by Nest, a company that has been in the business of making thermostats. Nest is owned by Google Inc. After the deal, the Google-owned company will then venture into making cameras that enable you to stream footage from your home right into your car or other compatible devices. Its just early this year when Google bought Nest for a whooping sum of $ 3.2 billion.

Google and Apple announce plans to enter smart home market

Google and Apple announce plans to enter smart home market

Other than Google, Apple is another tech giant that is set to revolutionize home systems. If the reports by The Financial Times that the tech giant will be taking advantage of its Worldwide Developers Conference, to be held next week, to discuss its new smart home platform is anything to go by, then all you can expect is a whole new dimension of living.

The tech giant, it is reported, will be looking for ways of making users of its iPhones use their devices as remotes that enable them to control the security systems, lights as well as other household appliances. That means that you can monitor activities in your home round the clock even from the comfort of your office or offshore tour.

Whether or not these new technologies will come to pass is just a matter of time as there are also other companies rushing to have their footprints on the smart home business. Be sure to have your dream smart home once the plans by the two tech giants are successfully implemented.

Source: USA Today
Image Source: Google