jquery

read pages html with jquery

I want to use jquery to read the html of a web page. I use the following $.ajax({ url: page, dataType: 'html' }); where page is the address of the page. This works fine if I want to read a page with the same domain as the calling page. However if I want to read a page from a different domain, it returns blank. ...

markitup settings issue

Here is my settings in set.js. I basically don't want the H1 - H3 tags, images etc. So I deleted those lines but my markitup text area appears to not like the settings and shows up like following. I am using the textile set with a basic simple skin. Also, is there a sprited version of the images? mySettings = { previewParserPath:...

Need to set the class of a parent div to that of a contained li element

I'm working on a side navigation element which needs to change color based on which menu is selected. I'm trying to set the class of a parent div to match that of a li which is part of the menu. Here's the code: <div class="cols" id="leftMenuWrapper"> <div id="leftmenu"> <ul id="navsub_657930_721861"> <li class="...

jquery: hide title attribute but not remove it

Hi, I have seen that most people will do it with this solution that on mouse over, we will grab the value in the TITLE attribute, then, remove its value. While on mouse out, we'll put it back on. $(this).attr('title',''); or $(this).removeAttr('title'); I want to know is it possible just hide the tooltip from appearing than remo...

jQuery live preventDefault failing on input elements

I have the following snippet of code: $('#messages input').live('keydown', function(e){ if(e.keyCode == 13) { alert($(this).attr('value')); e.preventDefault(); return false; } }); where "#message input" is obviously a group of input text elements. I want to catch the "enter" key and prevent it from refreshing the page....

load web page into jquery ui

is there anyway of loading a web page from a different domain into a jquery ui dialog? ...

Intercept Link Clicks from Frame

I have a old fashion page that uses a frameset containing a top frame and bottom frame. The frameset is defined in "index.html" and my code is as follows: <html> <head> <script src="jquery-1.4.2.min.js" type="text/javascript"></script> <script> $(document).ready(function(){ $('#mainFrame').ready(function() { ...

Remove or hide a div if it's empty

I know this should be simple but can't figure it out. Here's the code. <div class="cols lmenu_item1" id="leftMenuWrapper"> <div id="leftmenu"></div> </div> I simply need to remove the "leftMenuWrapper" if "leftmenu" is empty. Here's what I've been using. $('#leftmenu').empty().remove('#leftMenuWrapper'); Sorry if this is a simple q...

Uploading files with jquery's .post

Hi, I have form that uploads file's perfectly, with a post-page-refresh-form. However I have ajaxiefied the form with jquery's $.post All of the data except for the file upload is saving nicely. Is there somthing special I need to do to the form or in jquery to get the upload to work? Thanks! ...

Overriding Javascript Confirm() while preserving the callback

Hello all! To the point, I want to override the standard js confirm() function within a jQuery plugin. I have figured out how to do it with the simple function layout below. function confirm(opts) { //code } Now, what I want to do is call another function within the confirm function above, like so... function confirm(opts) { op...

How to start jquery datepicker with focus

I'm new to jquery and would like to start datepicker with focus. My first textbox is a date field and I have tried to give the box focus with javascript but datepicker won't come up unless I click somewhere else on the page and then give it focus by clicking inside the box. Is there a way to start datepicker with focus and maybe have t...

How to check what div span is placed in

I am trying to find out what div is the span is in using jquery. here is a eg. <div id='one'></div> <div id='two'></div> <div id='three'><span id="find_me"></span></div> thanks ...

Help with using jQuery with ASP.NET MVC

My app has a "Show all comments" similar to the one in Facebook. When the user clicks on the "show all" link, I need to update my list which initially has upto 4 comments with all comments. I'll show some code first and then ask some questions: jQuery: ShowAllComments = function (threadId) { $.ajax({ type: "POST", ...

Confirmation before deleting (jquery)

I would like to show a simple confirmation dialog box show before running a delete function. Here is what I have so far HTML: <!-- Delete Confirmation Dialog Box --> <div id="confirm" style="display:none;"> <div class="message">Are you sure you want to delete?</div> <div class="buttons"> <div class="cancel">No</div><div ...

Alternative to jQuery's slideDown() and slideUp() not affecting the display property.

Hello, I've been trying to use the slideDown() effect for a website I'm working on, but I'm having difficulty getting the effect I want. Here's a sample showing what I want to accomplish. <div> blahblahblahblah <span id="span_more" style="display:none"> blahblahblah </span> <a class="link_more" id="more">More...

find position of <li>

I am trying to find the position of Test3 in jquery can someone lead me down the right path please. I need jquery to display 5 <ul id="numeric" class="sortable boxier" style="margin-right: 1em;"> <li>Test7</li> <li>Test2</li> <li>Test6</li> <li>Test5</li> <li>Test3</li> <li>Test8</li> </ul> Thank you ...

How do I make my div IDs variable in rails?

I feel like there should be a simple way to do this, but I just don't know what it is. I have a list of data to display, and I want to include an AJAX "Read More" function to expand information at the bottom of each segment. To do this, I need unique div IDs within each segment. I have this code: <% for choice in @student_choices %> ...

jQuery UI Button - Text beneath the Custom Icon

I am trying to create a jQuery UI button with a custom icon on the top of the text. The default behavior creates icon on the left/right of the text but I want the icon to be on the top! Can this be done? If so, your help/guidance is greatly appreciated. Also, how can one have a 32x32 size Custom Icon (even increasing the height of the b...

Use jQuery to apply styling to all instances of clicked element

What I'm aiming for is for jQuery to look at the element I've just clicked on (for example a p or an li tag), then apply a styling to all instances of that element (so all p tags on the page). This is my code so far, but it only applies the styling to the single element that has been clicked on. $("article *", document.body).click(func...

inserting html with php on submit, but how to use jquery to fade out that html?

I'm inserting an h3 tag when a form is submitted. How do i fade that h3 tag out in 5 seconds using jquery? I tried this but it didn't work. Do i have to use .live? $(document).ready(function() { $('h3').delay(5000).fadeout(300); }); EDIT: I'm submitting the form to itself in case that matters. ...