[jQuery] Re: Determine content type in $.post callback

2009-07-14 Thread bjorsq
What you need is access to the XMLHttpRequest object used in the request so I suggest you use $.ajax instead of $.post. The "complete" callback for $.ajax receives the XHR and textstatus as parameters, so this should get you the headers: $.ajax({url:'your.url',data:{'data1':'one','data2':'two'}

[jQuery] Re: Determine content type in $.post callback

2009-07-15 Thread bjorsq
You don't have any problems here - ajaxSubmit can use all the options that $.ajax can, so all you need to do is place a "complete" callback in your ajaxSubmit options. As far as I can tell from the docs, the "complete" callback is your only option as it gets the XHR object as a parameter - but yo

[jQuery] Re: animate : animable properties

2009-09-14 Thread bjorsq
Try this: function filterInanimate(obj) { var newObject = {}; var goodProps = ['width','height','left','right','top','bottom','margin','background']; for (prop in obj) { if ($.inArray(prop, goodProps) != -1) { newObject[prop] = obj[prop]; } } return ne

[jQuery] Re: trim string

2009-09-14 Thread bjorsq
Try this: function filterArray(arr) { var newArr = []; for (var i = 0; i < arr.length; i++) { newArr.push(arr[i].replace(/[0-9\-.]/g, '')); } return newArr; } runrunforest wrote: > > > Hi, > > I have an array like this cat=(com12, com1, cop233, com1.1, sap-12-1)

[jQuery] Re: which submit button was clicked?

2009-09-15 Thread bjorsq
Hi, As far as I can tell, it is not possible to get the details of which submit button was clicked from the submit event of the form, as the event target will always be the form element. The way to implement this would be to assign a class to each submit button, then attach a click event to them

[jQuery] Re: Hide/Show based on radio button selected

2009-09-15 Thread bjorsq
Hi, In the following example, all the radio controls have the name attribute set to "myradio", and the "#offices_checkboxes" part of the document is shown when the radio with id 'radioOne' is checked. Your example probably didn't work because of the syntax you used in your attribute selector (no

[jQuery] Re: Help with getting variable

2009-09-15 Thread bjorsq
Hi Dave, Use a regular expression to split your form element names like this: var regex = /^(\w+)\[(\w+)\]\[(\w+)\]$/i; var str = "data[User][username]"; var matches = regex.exec(str); // matches[2] now contains "user" Dave Maharaj :: WidePixels.com wrote: > > > Hoping for some simple hel

[jQuery] Re: detect quicktime?

2009-04-27 Thread bjorsq
Jack, I've used the following code in the past and found it to work - it is from http://www.dithered.com/javascript/quicktime_detect/index.html where you can check out documentation, use cases, and download it (along with a redirection script if you need one). It is quite old, but should work. I

[jQuery] Re: How to get file name

2009-04-28 Thread bjorsq
This will only get you the first image filename in the document - to get all of them, use something like this: var filenames = []; $('img').each(function(){ filenames.push($(this).attr('src').split('/').pop()); }); now filenames contains the filenames of all the images in the page D

[jQuery] Re: generated content(PHP) into DIV?

2009-04-30 Thread bjorsq
Hi there, Here is a very simple implementation of what you are talking about - it assumes you have three divs in the markup with IDs 'place', 'house', and 'level', and that you load content for these from 'places.php', houses.php' and 'levels.php' respectively. It also assumes that the PHP files

Re: [jQuery] keep executing the script after a few seconds

2010-01-13 Thread bjorsq
setInterval(function(){alert("hello");},9); http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/ runrunforest wrote: > > Say i want the alert message "hello" appear every 90 seconds, how can > i do it ? > > -- View this message in context: http://old.nabb

Re: [jQuery] tabs in one line, on small resolution

2010-01-13 Thread bjorsq
Your problem is more related to CSS than jquery tabs. The element containing the tabs needs to be wide enough to contain them all in one line - it sounds like your containing element's width is set to the width of the browser window, so on smaller resolutions where the window is narrower, your con

[jQuery] Re: iterate over json

2009-01-06 Thread bjorsq
Try something like this (if you can't re-structure the JSON Object): $.each(myJSONObject.formValues, function(i,item) { var itemtxt = 'Object details for formValues['+i+']:\n\n'; for (prop in item) { itemtxt += prop + ': ' + item[prop] + '\n'; } alert(itemtxt); }); For

[jQuery] Re: Dealing with Date Comparison

2009-02-04 Thread bjorsq
To do this in JavaScript, you need to extract the text representation of the date you have in the div, parse it, and set up a new JavaScript Date object to compare against the current date/time. If your dates are formatted like [day]/[month]/[year] (I'm in the UK), then this should work (but will

[jQuery] Re: Ajax loading of HTML

2009-03-04 Thread bjorsq
Try taking out the dot in the URL you are loading and use an absolute URL - the "./" refers to a local filesystem path, which would explain it working locally but not online. davidnext wrote: > > > Hi All, > > I am having a problem with loading an HTML file to populate a dropdown > as follow

[jQuery] Re: iframe ang jQuery

2009-03-28 Thread bjorsq
Have you thought of using AJAX to embed the remote page within a instead of using an iFrame? I know you would have to use JSONP to get it to work across domains, so it kind of depends on how much control you have over each site. Another way of doing it would be using a proxy script to fetch the

[jQuery] Re: iframe ang jQuery

2009-03-29 Thread bjorsq
-resize, how can use use > Ajax to load the other website in a div. I want to embed a php driven > page in a asp.net website. > > I found this script online, but the script does not work: > > > > http://www.kaali.co.uk/article-Cross-bowser-iframe-auto-resize-script-

[jQuery] Re: Sortserialize returns nothing!

2008-02-12 Thread bjorsq
I'm using interface 1.2 with jquery 1.2.2, and this is what works for me: $(document).ready(function(){ $("#myList").Sortable({ accept : "sortableitem", onStop : function(e, ui) { serialize("myList"); } }); }); function serialize(s) {

[jQuery] Re: Sortserialize returns nothing!

2008-02-13 Thread bjorsq
I've recently updated my setup to jquery 1.2.3 and am using sortables from UI 1.5b. I couldn't get the serialize option to work either - something to do with the way options are parsed - by default it tries to match the ids of all sortable items to (/(.+)[-=_](.+)/) so I guess your IDs need to ha

[jQuery] Re: Defining regular expressions with # selector ??

2008-05-15 Thread bjorsq
If you want to get a set whose IDs start with "div1.", then you can use: $('[EMAIL PROTECTED]') You could also filter the result set with a regex like this: $('div').filter(function(){ return /^div1\./.test(this.id); }) Orcun Avsar-2 wrote: > > > Is it possible to define a regex with a # sel

[jQuery] Re: Can jquery change the period in an OL to a hypen?

2008-05-17 Thread bjorsq
Try this: $(document).ready(function() { $('ol li').each(function() { $(this).html($(this).html().replace('/\./', ' -')); }); }); What this does is go through all li elements of all ol lists and perform a String.replace() on the existing content ($(this).

[jQuery] Re: attr('form') not work in firefox

2008-05-19 Thread bjorsq
As the previous reply stated, there is no attribute "form" on the input element, but there is a "form" property on the input object which can be used to identify the form which the input is an ancestor of. If you need the form object in your example, all you need to do is select it using $('#myFo

[jQuery] Re: simple horizontal slide panel - IE7 DOM, Jquery

2008-06-11 Thread bjorsq
I have managed to get this to work - although probably not the best solution, by placing the panel and panel reveal link in a wrapper div, and placing them off screen. Your positioning was all a bit messed up - only the panel needs to have absolute positioning. The animate function slides the ane

[jQuery] Re: Draggable and Fadeto

2008-06-11 Thread bjorsq
I think what is happening here is you are binding the mouseover and mouseout functions to the #navigation , so when your mouse passes over the and elements inside it, the mouseout function is triggered (the mouse moves out as far as the is concerned, and over its child elements). You need to b