I suspect you are trying to send the header after loading any html, which will not work. The php header must occur before any output, including html, JQuery Mobile, etc. If this is not worked then you can try second option, which is causing problems using the <form> tag. After browsing through the jQuery Mobile […]
Category: JQuery
add the following script before including jquery.mobile.js
|
1 2 3 |
$(document).bind("mobileinit", function() { $.mobile.ignoreContentEnabled = true; }); |
Then you need to include data-enhance=”false” to your page where you want to stop jQuery mobile js apply styles
|
1 2 3 4 5 6 7 8 |
<div data-enhance="false"> <input type="checkbox" name="chk1" id="chkb1" checked /> <label for="<code>chkb1</code>">Checkbox</label> <input type="radio" name="test_radio" id="<code><code>radio_btn1</code></code>" checked /> <label for="<code>radio_btn1</code>">Radio Button test</label> </div> |
You can create your own custom validation method using the addMethod function. Say you wanted to validate “dd/mm/yyyy”:
|
1 2 3 4 5 6 7 8 9 |
$.validator.addMethod( "myCustomDate", function(value, element) { // put your own logic here, this is just a example return value.match(/^dd?/dd?/dddd$/); }, "Please enter a date in the format dd/mm/yyyy" ); |
And then on your form:
|
1 2 3 4 5 |
$('#myForm').validate({ rules :myDate : { myCustomDate: true } }); |
then put the class=”myCustomDate” where you need this validation like you use class=”required” on Jquery validation .
It is a good idea remove inline JavaScript, for example:
|
1 2 3 4 5 6 7 8 |
<a href="http://hridaya.com.np" class=""haslink>http://hridaya.com.np/a>; $('a.haslink').click(function(e) { e.preventDefault(); if (confirm('Are you sure?')) { window.location.href = $(this).attr('href'); } }); |
if you do not want confirm dialog then simply do this
|
1 2 3 4 |
$('a.haslink').click(function(e) { e.preventDefault(); window.location.href = $(this).attr('href'); }); |
it will goes to the page which you put on a href section . thanks
Is it possible to adding a CSS class to the 1st occurance of an element on a page? I have a list of lines like this: <div class=”classtest”><a href=test.html”></a></div> <div class=”classtest“><a href=test1.html”></a></div> <div class=”classtest“><a href=test2.html”></a></div> <div class=”classtest“><a href=test3.html”></a></div> Is is possible to add a CSS class (class=”myclass”) to just the first occurance of the above […]
This is a content management system.Actually this system is a integration of E-c0mmerce using Magento , for Content management system using Joomla And for forum SMF. So it is a huge system.
For displaying the random image from the available images, we can do this by writing a little code by the help of Javascript .
You have also required to declared the array of images which you are going to show different images in every refresh of the page.Then copy and paste the following code you can find your solution.
For displaying the random image from the available images, we can do this by writing a little code by the help of jquery.For implement this you have to download jquery library from the web .
You have also required to declared the array of images which you are going to show with auto refresh.Then copy and paste the following code you can find your solution.Enjoy it…
jQuery: The Basics This is a basic tutorial, designed to help you get started using jQuery. If you don’t have a test page setup yet, start by creating a new HTML page with the following contents:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
<html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> </script> </head> <body> <a href="http://jquery.com/">jQuery</a> </body> </html> |
Edit the src attribute in the script tag to point to your copy of jquery.js. For example, if […]
jQuery 1.2 introduced JSONP support, but on initial read of the release notes, I wasn’t completely sure what it was – so for anyone else that might want the Dr Seuss explanation.
You need to mould both your request and response to handle JSONP – and in doing so, you can have cross domain JSON requests.
JSONP is script tag injection, passing the response from the server in to a user specified function.
Your server will need to return the response as JSON, but also wrap the response in the requested call back, something like this in PHP (hosted on http://myotherserver.com):