After a bunch of animating, adding classes and setting css styles. is there an easy way to reset an element to be back in its original server delivered state?
Could you confirm I understand this correctly.
Using POST, the file specified in xmlhttp.open("GET","ajax_test.asp",true);
will not be cached (sent to \Temporary Internet Files) ? It will stay on the server only?
If this is true, is the updated html file after calling ajax POST, being updated in the \Temporary Internet Files ?
Am I missing any other important information of this mechanism?
Thank You.
Haven't seen this before so hopefully someone has a easy solve, I have a 3 feature panel divs side by side, what I want happen is the 1st panel has a "hover" class added so I can change the background etc and then on a timed interval the hover class jumps to the next panel then the next panel then back to the start on a loop.
Also on a side note can you keep the code in mind to be able to add more then 3 feature divs so you could have for example 6 or more or less etc.
I'm using twitter bootstrap in my application. i gave e.preventDefault for link button in $(document).reday(), but it is not working.
Here is my code:
Master page:
<a id="lnkLogout" href="javascript:void(0);" onclick="PageLogout();"><i class="icon-off">
</i>Logout</a>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$('#lnkLogout').click(function (e) { e.preventDefault(); });
});
function PageLogout() {
//Code for logout from the application....
}
</script>
SampleDefaultPage.aspx :
<div class="row-fluid">
<div class="form-horizontal">
<h4 class="header blue bolder smaller">
Contact</h4>
<div class="control-group">
<label for="form-field-email" class="control-label">
Email</label>
<div class="controls">
<input type="text" style="width:200px;" data-val="true" data-val-required="Mobile Number is required." id="txtEmail">
<div class="space-3">
</div>
<span data-valmsg-replace="true" data-valmsg-for="txtEmail" class="field-validation-valid text-warning red"></span>
</div>
</div>
<div class="control-group">
<label for="form-field-website" class="control-label">
Phone Number</label>
<div class="controls">
<input type="text" style="width:200px;" id="txtPhno">
</div>
</div>
</div>
I have given txtEmail as mandatory field. if i left that field blank and click on Logout button in Master page, it says txtEmail is required. i dint do any validation in Logout onclick event. I have given preventDefault for Logout link. But still facing an issue. I should be able to logout even though txtEmail is left blank.
Thank you all in advance for your response.
I have setup an HTML5 drag and drop upload into my site. The problem that I have is when a user is uploading a large file, they must wait for the upload to finish before navigating and using the rest of the site.
So, what I'd like to do is allow the user to drag files to the main site and then have it automatically open a new window and start the upload there so they can still use the rest of the site while the upload is happening. Anyone have and advice on how to accomplish this or if it can even be done?
I am trying to do an Ajax request for an ICS file. Yeah, I know it sounds crazy, but I found the perfect library to parse the iCal data. Any ideas why the data comes up blank when I do this?
$.ajax({
success:function(data){
alert(data);
},
url:"http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty2.pl/product=15714&cat=98&platform=osx&method=sa/Swiss32Holidays.ics"
});
It makes the request fine, but the data still comes up blank.
I know this borders on the taboo here, and please don't reply with "you should never do this etc" I have a very long form in a wizard, some users are too used to using the browsers back and forward buttons that they use those instead of the "Back" and "Next" buttons on the form wizard. If they hit the browsers back button they lose all of their form data which is a pain in the ass, since form is so long. Is it possible to display an alert that when will have a "take me out of here" and a "cancel" button so if they hit cancel it will cancel the function of the back button?
Thanks!
Hello everyone I have this code working fine but I want the script to stop on the mouse up event.
Here is an example of what I have now.
How can I stop the script on mouse up event so that it looks like it only shows the coordinates when dragging over the image.
Thank you!
http://jsfiddle.net/Hc7x4/20/
$(document).ready(function () {
$("#map-catcher").mousedown(function (e) {
$("#map-catcher").mousemove(function (e) {
$("#coord").text("x:"+e.offsetX+", y:"+e.offsetY);
return;
});
$("#map-catcher").mouseup(function (e) {
return;
});
});
});
Hi,
I have a drop down field that if any items of it selected,it would be disabled,after that i submit the form,but then (after submitting) the drop down field dosent have any value, I want to have a value after submit but my drop down field is empty.
Thanks for any help,
(sorry for my English)
Hello, I have a Jstree that holds a lot of nodes, some of them have the same ID.
I was wondering, how do I make it so that if someone selects
one of the nodes, it would select every node with the same id.
I tried working with the
onselect: function (node) {
but I'm not sure what exactly to do,
plus I'm not sure how to manually select a node
(because it's all done with the selected: attribute)
The following code works:
$(".valClear").each(function () {
if ($(this).val().indexOf(".png") == -1) {
$(this).val('');
}
});
However this doesn't (the value is removed even if it contains .png or .jpeg), what am I doing wrong?
$(".valClear").each(function () {
if (($(this).val().indexOf(".png") == -1) || ($(this).val().indexOf(".jpeg") == -1)) {
$(this).val('');
}
});
http://jsfiddle.net/5DB6K/
I have this game being made where you shoot enemies from the sides of the screen. I've got the bullets moving and being removed when they reach the end of the screen (if they didn't hit any enemy) and removing the enemy when they collide with it.
//------------collision----------------//
if(shot === true){
bulletY = $('.bullet').position().top + 2;
bulletX = $('.bullet').position().left + 2;
$('.enemy').each(function(){
if($('.enemy').hasClass('smallEnemy')){
enemyY = $(this).position().top + 7;
enemyX = $(this).position().left + 7;
if(Math.abs(bulletY - enemyY) <= 9 && Math.abs(bulletX - enemyX) <=9){
$(this).remove();
score = score + 40;
bulletDestroy();
}
}
});
}
However, the bullet destroys every enemy if the collision check is right which isn't what I want. I want to check if the enemy has the class of either smallEnemy, medEnemy, or lrgEnemy and then do the collision check which is what I thought I had but it doesn't seem to work.
Also, the game starts to lag the more and more time goes on. Would anyone know the reason for that?
I've been using the ASP.NET Ajax Control Toolkit Slideshow extender and while it works, I'm not totally satisfied with it as it has problems handling multiple slideshows on one page and the fade is choppy. Anyone suggest any alternatives?
Hi all,,,
I am trying to do a small thing, any 1 help me, I really appricciate...
I have a drop down menu,I want when I select the value, it will call the related data, which I am access with php+mysql, I dont want to jump to other page and show
Hi All,
Is it possible to post, say like a value in a textbox, to 2 different ajax forms that are on the same page? It doesn't have to be at the same time?
What I'm trying to do is this: I have a search page that searches for customers and displays them on a paged grid. Users can specify up to 5 parameters (5 textboxes) to narrow the search.
On the same page I have an export option. Well since I want all the customers for the search and not just the paged data I need a way to post back to the server for this option passing the same parameters used in the grid.
I'm using a ViewModel which would be nice if I can pass that back to the server rather than the individual search fields that are backed by the view model.
Thanks,
rodchar
Hi All,
I am using <script> inside the body tag.
<script type="text/javascript" language="javascript">
$('#audioVolume').text($('#audioVolume').text(Math.round((document.mediaPlayer.Volume + 2000) / 10) + "%"));
</script>
Error: Microsoft JScript runtime error: 'undefined' is null or not an object.
Need: I want to access the html elements in <script inside the body tag.
I cant work out which brackets are in the wrong place and where and now im completely lost:
$("#slid").click(function() {
$("#div1").animate({ top: "25px",}, 300
},function() {
$("#div1").animate({ top: "85px",}, 300
});
});
Can anyone help?
Hello
I just want to enable / disable onclick and href on elements (a or div).
I don't know how to do this.
I can disable onclick by adding an handler on click event, but the href is still available.
$(this).unbind().click(function(event){
event.preventDefault();
return;
});
FOUND A HACK FOR A ELEMENTS
if ($(this).attr("href")) {
$(this).attr("x-href", $(this).attr("href"));
$(this).removeAttr("href");
}
if I put a div in the head and display:none, than use javascript to display it, will this work?
Edit:
I have stuff loaded in ajax. And as my ajax changes the "main" portion of the site, I want to change the meta-tags as well.
lets say I have a html page.
<html>
<body>
...
This is my HTML Page, full of html objects and mouse events on them
...
<div id='blocker' style="height: 100%; position: absolute; width: 100%; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1001; background: none repeat scroll 0% 0% black; opacity: 0.5;"></div>
<div id='window_to_my_html_page' style="display: block; left: 50px; top: 50px; width: 200px; height: 200px; z-index: 1002; position: absolute;"></div>
</body>
</html>
In this example div which id is 'blocker' will block all mouse events from my page.
All my HTML page elements behind of my second div(which id is 'window_to_my_html_page') must be active, all mouse events must work on them, this div must be like a window to my HTML page
I want to make all elements from my HTML page active(to work as normal) inside this area (left: 50px; top: 50px; width: 200px; height: 200px).... and other content, outside of this area make inactive
The question: how can I do it?
I have a two or more forms on my page in a row.
I'm trying to hook submit event like:
$('form',someObj).submit(function(e){
/* Do some stuff with ajax */
return false;
});
But always receive events only from a first (by code) form.
Also used each() function to bind event for each object, same thing..
What's wrong?
Thanks!