www.webdeveloper.com
Results 1 to 2 of 2

Thread: need data from php file after clicking a button

Hybrid View

  1. #1
    Join Date
    Jan 2013
    Posts
    2

    need data from php file after clicking a button

    Hello,

    I'm pretty new in javascript en jquery.

    i'm trying to upgrade a website.
    for this site i need to load/build a foto gallery after a onclick event.

    but i don't know how to do this.

    i know how to read data from a mysql databast within PHP, i think i could create a array of this data.
    but i don't know how to get this data(array) from the php file in my main page.

    how could i run the php code after an onclick event, and how do i parse the data from the array to a data source (json)

    below is a snapshot of the data source
    Code:
    	var source = {
    		datatype: "json",
    		url: 'data_load_gallery',
    		datafields: [
    			{ name: 'thumb' },
    			{ name: 'image' },
    			{ name: 'big' },
    			{ name: 'title' },
    			{ name: 'description' },
    			{ name: 'link' }
    	],
    	id: 'thumb',
    	async: false
    	};
    and the on click event.

    Code:
                 $("#jqxButton").bind('click', function () {
                       some code that run's a php file and get the data array into the above data source.
    								
    								});
    i hope someone could help me with this, or point me to an example.

  2. #2
    Join Date
    Jan 2013
    Posts
    2
    there is some code missing in the onclick event.

    after reading the data from the php file it goes in this line

    Code:
    $('#galleria').data('galleria').load(data_from_php_file);

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles