$(document).ready(function() {
$('#myid').click(function() {
$.get('person/show');
});
});$(document).ready(function() {
$('#myid').click(function() {
alert('TEST');
});
});extremlife wrote:Thank you for your fast reply, but unfortunately it doesn't work.
I tried to use alert() at the same place:
- Code: Select all
$(document).ready(function() {
$('#myid').click(function() {
alert('TEST');
});
});
it works fine. But the action call seems not working, because there is nothing happening. I'm so desperate, i need to get that working...
GET http://easy.localhost/frontend_dev.php/de/userProfile/show 200OK 169ms
Header
Antwort-Header
Date Fri, 15 Oct 2010 12:19:54 GMT
Server Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By PHP/5.3.1
Content-Length 5018
Keep-Alive timeout=5, max=90
Connection Keep-Alive
Content-Type text/html; charset=utf-8
Anfrage-Header
Host easy.localhost
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729)
Accept */*
Accept-Language de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 115
Connection keep-alive
X-Requested-With XMLHttpRequest
Referer http://easy.localhost/frontend_dev.php/de/
Cookie symfony=qtf0renn716asplhquvekeskv5
public function executeShow(sfWebRequest $request) {
echo "test";
}temp = $("#combobox").val();
$.get("profile/show?id=temp");extremlife wrote:well I just want the code in the action to execute...
extremlife wrote:the code in action doesn't really seem to be executed for me, although in the firebug console under the point "response" i see the complete code of showSuccess.php. Do I missunderstand something?
extremlife wrote:
- Code: Select all
public function executeShow(sfWebRequest $request) {
echo "test";
}
It should show "test".
$(document).ready(function() {
$('#myid').click(function() {
$.get(
'person/show',
// You may be able to use the query string syntax, but this looks like the preferred way
{ id: temp },
// This is your 'ajax query finished' event
function(data, textStatus, XMLHttpRequest) {
// Insert the returned data into a specific place in the document (empty it first, then append it)
$('#yourdiv').empty().append(data);
},
'html'
);
});
});extremlife wrote:
- Code: Select all
temp = $("#combobox").val();
$.get("profile/show?id=temp");
"profile/show?id=" + temp$('#yourdiv').empty().append(data);GET http://easy.localhost/frontend_dev.php/group/show/id/2localhost/frontend_dev.php/group/newGET http://localhost/frontend_dev.php/group/person/show?id=3 404 Not Found 120msextremlife wrote:What if I have in my action a redirect() call? It is not redirected to the called action
jQuery.ajax({
...
success: function (data) {
//redirect to another action
window.location.href = "<?php echo url_for('@yourlink') ?>"
}
})
What if I have in my action a redirect() call? It is not redirected to the called action, although I can see the call in the Firebug console
defaka wrote: //redirect to another action
window.location.href = "<?php echo url_for('@yourlink') ?>"
[/code]
localhost/<?php echo url_for('group/show') ?>window.location.href = 'group/show';localhost/group/showlocalhost/userlocalhost/group/showlocalhost/user/testlocalhost/user/group/showextremlife wrote:
- Code: Select all
localhost/<?php echo url_for('group/show') ?>
window.location.href = "<?php echo url_for('@yourlink', true) ?>"
(function( $ ) {
$.widget( "ui.combobox", {
_create: function() {
var self = this,
select = this.element.hide(),
selected = select.children( ":selected" ),
value = selected.val() ? selected.text() : "";
var input = $( "<input>" )
.insertAfter( select )
.val( value )
.autocomplete({
delay: 0,
minLength: 0,
source: function( request, response ) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
response( select.children( "option" ).map(function() {
var text = $( this ).text();
if ( this.value && ( !request.term || matcher.test(text) ) )
return {
label: text.replace(
new RegExp(
"(?![^&;]+;)(?!<[^<>]*)(" +
$.ui.autocomplete.escapeRegex(request.term) +
")(?![^<>]*>)(?![^&;]+;)", "gi"
), "<strong>$1</strong>" ),
value: text,
option: this
};
}) );
},
select: function( event, ui ) {
ui.item.option.selected = true;
self._trigger( "selected", event, {
item: ui.item.option
});
var temp = $( "#combobox" ).val();
$.get(
'group/change',
{ id: temp },
// This is your 'ajax query finished' event
function(data, textStatus, XMLHttpRequest) {
window.location.href = 'user/show';
},
'html'
);
//alert("Your chosen combobox is : " + $( "#combobox" ).val());
},
change: function( event, ui ) {
if ( !ui.item ) {
var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ),
valid = false;
select.children( "option" ).each(function() {
if ( this.value.match( matcher ) ) {
this.selected = valid = true;
return false;
}
});
if ( !valid ) {
// remove invalid value, as it didn't match anything
$( this ).val( "" );
select.val( "" );
return false;
}
}
}
})
.addClass( "ui-widget ui-widget-content ui-corner-left" );
input.data( "autocomplete" )._renderItem = function( ul, item ) {
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( "<a>" + item.label + "</a>" )
.appendTo( ul );
};
$( "<button> </button>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All Items" )
.insertAfter( input )
.button({
icons: {
primary: "ui-icon-triangle-1-s"
},
text: false
})
.removeClass( "ui-corner-all" )
.addClass( "ui-corner-right ui-button-icon" )
.click(function() {
// close if already visible
if ( input.autocomplete( "widget" ).is( ":visible" ) ) {
input.autocomplete( "close" );
return;
}
// pass empty string as value to search for, displaying all results
input.autocomplete( "search", "" );
input.focus();
});
}
});
})( jQuery );window.location.href = "<?php echo url_for('@yourlink') ?>"http://mySite/<?php echo url_for('@yourlink') ?>myurl = document.URL;$(document).ready(function() {
$('input[name=properties]').live('change', function(){
var property_div=$('#property_div');
var selected_value=$("input[name='properties']:checked").val();
$('#loader_bd').show();
property_div.load('myacton/show',{
property:selected_value
}, function(){
$('#loader_bd').hide('slow');
});
});
});
Users browsing this forum: No registered users and 1 guest