Hey, i think this is simple, but I can't get it to work! :(
def ajax_filter(request):
area_id = request.REQUEST.get('area_id')
outlets = Outlet.objects.filter(zipcode__area=area_id)
json_serializer = serializers.get_serializer("json")()
data = json_serializer.serialize(list(outlets), ensure_ascii=False)
return Htt...
i am struck with a problem in jsp.
in my form i have 2 drop down boxes.
depending on the value selected in the first box (which is populated from DB), i have to populate the second box from the database.
is it possible using jsp and javascript?
i did try to retrieve the value selected in the first menu using javascript n pass it in d qu...
I want shortest source code of passive view in several languages Java, C#, PHP, Flash, Objective C and Javascript. I don't want whole frameworks (like javascriptmvc) but tutorial with shortest example possible with complete source code. I can find some searching google in java c# but not for scripting languages, that's quite surprising ...
Coming from Ruby to Javascript, creating DSL now seems not as fun as in Ruby where it was very beautiful and elegant.
Ruby Rake:
task :hello do
# do stuff
end
task :hello => [:dep1, :dep2] do
# do stuff
end
Javascript Jake:
task("hello", function() {
// do stuff
});
task("hello", ["deep1", "deep2"], function() {
// do ...
Hi to all,
i would like make a simple script that store one dynamic image (Random) in a variable and then show that in another page (Like before).
This is the source code that show the image in the 1st page (Where i need to store):
<img alt="CaptchaA" style="display:block;" src="image_gen.php?rnd=8900yh0484" id="captchaB" name="captch...
Hi,
is it possible to decide at runtime which properties of a JS object should be enumerated?
Something like
myobj = {};
myobj.keys = function() { // I made this keys function up. Is there something like that in JS?
if ((new Date).getSeconds() < 30)
return [1,2,3];
else
return [4,5,6];
}
for(p in myobj)
console.log(p);...
I have the following output.
<tr id='row_27' valign='top'>
...
...
<td width="5%"><a href="http://localhost/daikon2/index.php/projects/admin/delete_log/6/6/27" class="deleteme"><img src="http://localhost/daikon2/assets/icons/delete.png" alt="delete" title="Delete Log" /></a></td>
</tr>
I want to get the last segments 27 in the href...
Hello,
Here's what I want to happen
Anything the variable hash contains: #/projects/X
X being anything other than blank, I want to fire an alert
Fires Alerts
#/projects/X
#/projects/X/boo/123/123/ads/asd/ads/ads
Does not fire an alert
#/projects/
Suggestions?
...
i want to call "OnChange Event" in javascript without refresh page?
...
This is a question that never has a proper answer, i have search the net many times and i couldnt find a solution.
xhr.open("GET", fullurl, true);
if(xhr.overrideMimeType) xhr.overrideMimeType("text/html; charset=ISO-8859-1");
xhr.send(null);
xhr.onreadystatechange = function(){
if(xhr.readyState == 4){
if(xhr.status == 200)
alert...
How can I index mp3 files on user side and create a database of file name, artist name album name etc and upload them on a server?
I would like a HTML 5 solution, although Flash or JavaScript would do.
...
I am using ext.js tab panel of coolite. How to handle the beforetabchange event in case of tab panel. Please help me with some sample codes.
thx in advance
EDITED:
Here is the following html code and I need the handler which will stop the tab-change propagation based on certain condition.
[code]
Tab-1
</ext:Tab...
hi everyone,
could someone explain to me how the Closure works in more user-friendly form? Its help and documentation leads me nowhere really. How do you perform a simple task such as selecting and modifying the dom (e.g. select all on page and hide them)?
...
I'm looking for a tutorial on how to use Jpolite with ASP.NET. Does anyone have this?
...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Script2.aspx.cs" Inherits="Javascript.Script2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="javascript" type="text/javascript">
function ClearValue(Text1, Text2) {
var...
Hi,
I can pass a variable from MVC ASP.NET by using this :
var lastCategoryId = '<%=Model.CS.LastSelectedCategory %>';
This work fine with string or integer but how do I do with an array of strings? I have tried to pass the array the same way but the variable is set to System.String[] ?
BestRegards
...
I have 4 asp:Textbox fields on a form. IDs being A1, A2 and B1, B2 for simplicity.
If any one of the As or Bs is populated, I need to hide the other one. So I enter something in A1, hide A2, enter something in B2, hide B1.
I thought I could use a javascript OnBlur event to do this but it doesn't do anything unfortunately. I'm trying ...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Javascript._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="javascript" type="text/javascript">
function ClearValue() {
var txtNam...
Google map api is not showing zoom bar and imagetype completely instead it is just displaying plus minus buttons for zoom in and out and drop down for selecting map type.
Url is http://booking.smanager.net/design/index.php?lv=2 please see tab "Location". I m using firefox 3.6.10. What might be the reason?
var myLatlng = new google.maps...
I'm trying to validate a form, but doesn't work :\ , When I submit the form goes to mail.php even if the required fields are missing, but I set onsubmit to validate() so it should check, but doesn't work. What's the problem with my code? I can't find it.
HTML:
<form action="mail.php" onsubmit="return validate()" method="post" class="co...