Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#trace").bind('click', $.proxy(function(event) {
- var button2 = $('#combo').val();
- if(button2 == 'default') {
- var trans = 'Default View';
- }
- if(button2 == 'abc') {
- var trans = 'abc';
- }
- $.ajax({ // ajax call starts
- url: 'serverside.php', // JQuery loads serverside.php
- data: 'button2=' + $('#combo').val(), // Send value of the clicked button
- dataType: 'json', // Choosing a JSON datatype
- success: function(data) // Variable data constains the data we get from serverside
- {
- JSGraphIt.delCanvas('mainCanvas');
- $('.test').html('<h1>' + trans + '</h1>'); // Clear #content div
- $('#mainCanvas').html(''); // Clear #content div
- $('#mainCanvas').append(data);
- JSGraphIt.initPageObjects();
- }
- });
- return false; // keeps the page from not refreshing
- }, this));
- // Boxes
- while($row = sqlsrv_fetch_array($result))
- {
- echo '<div id="'.$row['id'].'_block" class="block channel" style="background:';
- $(document).on('click', '.block', $.proxy(function(event) {
- var input = $(event.target).attr('id');
- var lines = input.split('_');
- var button = lines[0];
- $.ajax({
- url: 'srv.php',
- data: 'button=' + button,
- dataType: 'json',
- success: function(data)
- {
- $('#content').html('');
- $('#content').append(data);
- }
- });
- return false;
- }, this)); // End Application Details
- $(".channel").click(function () {
- alert('channel');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement