‏إظهار الرسائل ذات التسميات jQuery. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات jQuery. إظهار كافة الرسائل

الثلاثاء، 31 ديسمبر 2013

Jquery datepicker format date not working

Thats the default, meaning it does not recognise your option.

try:

dateFormat: 'dd-mm-yy'

(small letters)


View the original article here

الثلاثاء، 24 ديسمبر 2013

How to replace text between two XML tags using jQuery or JavaScript?

I have a XML mark-up/code like the following. I want to replace the text inside one of the tags (in this case ...) using JavaScript or jQuery.

A new beginning Stuff here...

The source is inside a textarea. I have the following code, but it is obviously not doing what I want.

code=$("xml-code").val(); // content of XML sourcenewBegin = "The same old beginning"; // new text inside tagsnewBegin = ""+newBegin +""; code=code.replace("",newBegin); // replace content

This is just appending to the existing text inside the begin tags. I have a feeling this can be done only using Regex, but unfortunately I have no idea how to do it.


View the original article here

الجمعة، 20 ديسمبر 2013

jQuery: how to use comma as separator for .each loop

I am using the following to loop through all fields with a specific class and add their values to a variable. This works fine so far.

What is the best / fastest way to add a comma as a separator between the values in the variable here BUT avoid having a comma at the beginning or the end of the variable's content ?

The content of the variable in the end should look like this: value1,value2,value3, ...

My function:

var myVariable = '';$('.myClass').each(function(){ myVariable += $(this).val();})

Thanks for any help with this, Tim.


View the original article here