designing4u.de Yet Another Coding Blog

21Jul/085

jQuery – show / hide button for multiple div containers with AJAX and JSON

This time I will consider another case of loading content into div containers using jQuery, AJAX and JSON request. In an other example I showed you how you can simply load content into one div container using AJAX and provide a user show and hide button.

In this example I want to consider a different case. Sometimes you don't only have one div container which needs to be filled out with content but multiple containers which need to be filled out with content according to the link which was clicked by the user. Again we will provide a functionality of changing the label of our button. We will extend this example by handling a larger amount of data in our response. For that reason we will use build in functionality of jQuery to handle JSON requests.

19Jul/080

Symfony – no error message on empty values in not required fields

It's been a long time since I wrote my last post, but I kept myself busy with work. I'm just working with another web 2.0 project (yes, there will be another web 2.0 project :) , which was written using symfony framework. I need to admit that my previous experience with different frameworks was pretty good, but symfony is different and I'm really excited about it. In a way it is similar to CakePHP using MVC patter but it has features, which I couldn't find in Cake. I mean symfony has its pros and cons but I find it really easy to build database models and modules using CLI and ORM. Propel is probably not the best abstraction layer, but I was reading on Doctrine site (which I personally find better than Propel) that it will be included in the new 1.2 release. I don't want to write a lot about symfony here, but rather solve a validation problem I encountered during development.

4Jun/080

Loading content into multiple div containers using jQuery and JSON

Because I didn't write anything in a long time and because I just changed the layout of my site, I decided to write a new example about jQuery and extend it this time with JSON. After studying google analytics I noticed that people are mostly interested in jQuery examples and specifically in showing and hiding content after users click. Because I already covered this example, I decided that this time I'll show you, how to load content into different div containers at one time. If you assume that you want to load content into more boxes, you definitely need to use JSON (JavaScript Object Notation). Of course one can say that XML would be suitable for this example as well, but the advantage of JSON is that it doesn't produce that much overhead. Of course XML is more versatile than JSON but with build in function of jQuery you can easily process received date.

4Jun/080

New design

Because I am not a CSS guru and I was tired with adjusting my style sheets for every single browser (mostly IE6) I decided to redesign my blog and use YAML framework. I really enjoyed working with it. It gives you plenty of dummy layouts, which you can use and change according to your needs. I am still not fully satisfied with this layout, but it is better than before. If there are any designers around looking at my blog I have an offer for them. I am not a designer, but I can help you with your programming. If you have problems with your site, we can make a deal. If it's not a big project I can write it for you, and you can make a new design for me. How does it sound?:) I'm waiting for your offers.

Filed under: YAML, trash No Comments
23May/081

jQuery drop down – loading content according to option

It was a really busy day for me today, so I came up with a simple code for displaying content according to the option our user chooses from drop down list. What we will try to accomplish is to provide a user a drop down list and load content from a remote PHP file using AJAX request. Additionally we will filter the data and display only the content relevant to the chosen option. We will also make use of chainability of jQuery and add a nice fade in effect after the text is loaded.

22May/085

Google maps, jQuery and XML – displaying a simple navigation

After I wrote my last example yesterday, I just realized, how easy you can add a simple navigation to your map, whereas after you click on the link an information window will be provided right above the according marker. I think it's a nice way to provide your visitors a possibility to choose what they want to see instead of randomly clicking on markers to find out what are they displaying. This time I will also show, how you can easily create an XML document using DomDocument class, which should be installed by default in your PHP5 version, which we will later use to display the markers.

21May/086

Setting boundaries for google map with more markers using jQuery

For a project I'm currently working on I had to display more markers in one google map. No problem at all, but only if all of them are placed in one city. You can just set up default level for the city and display as many markers as you want. In my case I had to display latest markers, which were saved all over the country. One would say no problem at all, just use default zoom level for the country and display the markers. What if 10 latest markers were placed in one city though? It would look stupid if they would be displayed covering each other. Additionally we do not want to use an onload event, therefore, we will use jQuery in this example. For this kind of problem google came up with a pretty nice solution.

Pages

Categories

Blogroll

Archive

Meta