Heya all,
First of all I would like to say that while this is the first time i post here these boards have helped me much.
With that said, I have got a strange issue regarding AJAX and scripts.
You see, in my web application i used custome JS context menus. Now each of them menus is implemented with specific features depending on the object and if the object exists.
E.x : if we got an upper menu place holder but no upper menu the context menu will have one option which is "add
I'm loading an ajax-loader gif whenever a voting button is clicked. The image however appears for all items. I'm trying to find out how to load the image just for the item I voted. This is my code.
$(document).ready(function(){
$(".vote").click(function(e) {
$('.ajax_load').html('<img src="/images/ajax-loader.gif" />');
var item_id = $(this).attr("id");
var dataString = 'item_id=' + item_id;
$.ajax({
type: "POST",
url: "vote.php",
My application is heavily using ajax for performing many operations. I want to disable the ajax requests coming from external websites. Is there any way of doing it? In addition, I heard that for security reasons ajax don't work on external domains, If so, how to enable ajax request coming from external domains on certain pages of my website to provide some specific data to other website.
Require some advice to get me started.
Just trying to do something simple at the moment for learning purposes.
Written a simple html page, with some javascript on a 'client'.
I need a way of getting a file list from my own webserver (including info such as date modified), that I can run from my simple page somehow.
So my question, is javascript + ajax the way I should be approaching this, or is there an easier/better way. Links to tutorials/examples greatly appreciated.
Thanks.
I am building a WordPress website where I add a random color to every post background. The code I am using is below:
// Background color animation
$(document).ready(function(){
$(".texts").hover(function() {
},function() {
$(this).animate({ color: "#FFFFFF" }, 500);
});
// Fun with Color. Differnt font color each time hover
// Original code can be found http://davidwalsh.name/jquery-random-color-animate
original =
I'm trying to populate a third set of radiobuttons as an addition to the following script: http://www.electrictoolbox.com/json-data-jquery-php-radio-buttons/
For some reason I cannot seem to fill the third set with the corresponding data. It just stays blank :(
Calling the populateFruittype() function only gives back [ ], while populateFruitVariety() returns the json data correctly.
getdata.php (DB connection / fetching data)
<?php
$dsn =
I have the following code that works in every browser but IE. When click on the submit button of the form I get no response at all from IE.
form has this value: onsubmit="sendform(this);return false;"
<script type="text/javascript">
function makeRequest(url) {
var http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
try {
One reason we currently use UpdatePanels for doing our AJAX is because our BL and DA layers pass around the Page.User.Identity for authentication.
Is there a way to access this?
Yes, you can get the current user via HttpContext.Current.User. From the MSDN documentation for Page.User:
This property uses the HttpContext
object's User property to determine
where the request originates.
As for your broader question, "How can I use jQuery Ajax and PageMethods with instance
The code is this:
<ins>
<div class="dropdown">
<ins> </ins>
<ul id="eventselect">
<li><a href="javascript:;" rel="Birthdays">Birthdays</a></li>
<li><a href="javascript:;" rel="Graduation">Graduation</a></li>
<li><a href="javascript:;" rel="Wedding">Wedding</a></li>
<li><a href="javascript:;"
I am using Zend, PHP, AJAX, JQuery in my projects. Question is that how can I force to not display a link on browser's statusbar when I mouseover on a link on my webpage.
Best example is on this site, when you mouseover the up-vote link on this site, it does not show the link and after click the votes increased without refreshing the page.
Thanks
On Stack Overflow, you don't see an address, because it isn't a link (i.e. it isn't an anchor). It is a span, image or other element,
I am taking my first steps with Ajax while working on a Grails application. I am using
<g:form ...>
<g:submitToRemote ... />
</g:form>
in the most simple way and it worked great out of the box (Thanks grails!). The problem is, that the Ajax call needs about 2 seconds to return and update the html (at least on the test system) and during that time, the user can (and actually does quite often) hit the submit button again. At the moment this results in a 2nd call
What's better of this two options:
1. $.post( '/ajax/action', function(data) { doResult(); } );
*This option has to receptors: ajax.php and action.php*
or
2. $.post( '/action', { typerequest: 'ajax' }, function (data) { doResult(); }
*This option has only 1 receptor: action.php (if typerequest exists, returns ajax result)*
Form without ajax looks like:
<form action="/action">
No difference between those two, really. Pick whatever is easier for you.
I think it