627 Posted Topics
![]() | Re: Get rid of the `$(document).ready(function(){...});` "wrapper". You need that only when you need to execute something as soon as the page has loaded. In your case, by the time the user selects something, the page is already loaded, so you just need to make the `load()` method call immediately. function … |
Re: > but the javascript is still giving me an error with the obj = JSON.parse(ret); That's because on line 16, you supplied the `dataType: 'json',` option. By doing so, you are telling jquery that the data you are sending from the server is JSON. As a result, when the request … | |
Re: On line 11 you have: $('.codeForm tr:last div[id="status"]').attr('id', '#status' + counter + ''); which ends up generating `<div id="#status">...</div>`. Get rid of the hash symbol. You need the hash symbol only when using selector expressions for jquery, not for the actual ids of the elements. It should be: $('.codeForm tr:last … | |
Re: try: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^/?index\.php\/(.*)$ /index.php [R=301,L] </IfModule> | |
Re: `is_int(1)` should return `true` since 1 is an int primitive. However, `is_int("1")` should return `false` because you are checking a `string` (that happens to have a numeric character, but is a string nevertheless). A form's input (as in `$_POST['id']`) or url parameter (as in `$_GET['id']`) is always a string, even … | |
Re: >I find some of the OO aspects a bit confusing: It seems that an image is turned into an object simply to be able to process it from within an array, programatically. If I am not mistaken, you are referring to lines 17- 23 on your original post. If so, … | |
Re: Try: var commentContent = $('textarea.comment-box#comment'); commentContent.keydown(function(e){ /* see: http://www.quirksmode.org/js/events_properties.html */ var code; if (!e){ var e = window.event; } if (e.keyCode){ code = e.keyCode; } else if (e.which){ code = e.which; } if( code == 13 && !e.shiftKey && commentContent.is(":focus")) { e.preventDefault(); commentForm.submit(); } }); | |
Re: There could be various reasons. To name a few: 1. Invalid/Wrong path to the stylesheet 2. Invalid characters in the stylesheet 3. Improper syntax 4. Insufficient Permissions on the file Open the XSL file directly through FF. If the problem is any of 1-3, then it will tell you on … | |
Re: try: [CODE=html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>JQuery Form Example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script type="text/javascript"> $(function(){ $('#myform').bind('submit',function(){ $.post('process.php', $("#myform").serialize(), function(data) { $('#results').html(data); }); }); }) </script> </head> <body> <form name="myform" id="myform" action="" method="POST"> <!-- The Name form field --> <label for="name" id="name_label">Name</label> <input type="text" name="name" … | |
Re: To answer your question, first obtain a reference to your table. If you have your table an id: [icode]<table id='MyTable'>...</table>[/icode] then use [icode]var t = document.getElementById('MyTable')[/icode] to obtain a reference to the table. Since 't' now holds a reference to the table, then assuming you are interested in the x+1th … | |
Re: count is a keyword, so you MUST wrap it in backticks. As a matter of fact, it is better if you always put backticks around your field and table names, that way you will always avoid this problem: NOTE: The general syntax is: [iCODE]UPDATE [COLOR="Green"]`TableName`[/COLOR] SET [COLOR="green"]`fieldName`[/COLOR]='value'[/iCODE] Based on what … | |
Re: [QUOTE] then when I send the paragraph to my mobile phone, I get 162 characters[/QUOTE] see if you have a javascript onsubmit function that changes carriage returns and/or new lines to spaces before submitting. Also, check (for the same thing mentioned above) on the server script to which you are … | |
Re: change: [CODE]mysql_select_db("lola", $con);[/CODE] to: [CODE]mysql_select_db("lola", $con) or die( mysql_error() );[/CODE] Most likely the user aby does not have any privileges on the lola db. ![]() | |
Re: Try changing `include('../../../datalogin.php');` to `require_once('../../../datalogin.php');` to make sure that the file is actually being included. | |
Re: > Test this code For that, you will need to provide the missing javascript file (grid.js). Are you sure you have the correct name/path to the grid.js file? | |
Re: For the sake of clarity, let's say that your site is jonna.com and that your database.mdb is located at jonna.com**/Databases/database.mdb**. try: 'Get the 5 newest news items Set conob2 = Server.CreateObject("ADODB.Connection") conob2.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/Databases/database.mdb") & ";" Set objRec2 = Server.CreateObject("ADODB.Recordset") Dim sql2 sql2="SELECT TOP 5 news_date, news_text … | |
Re: Try: $lines = file(getcwd().'/data.txt'); foreach( $lines as $line) { if( preg_match('/^In our tests\D+(\d+)\D+(\d+)/',$line,$matches) ) { print_r($matches); } } If there are any matches, then the variable ***$matches*** will contain the data you are after. | |
Re: You need to do the iteration on the server (via PHP). Since all four of your PHP array have the same number of elements, iterate over one of them and use that numeric index to retrieve the equivalent element from the other arrays. Try: <?php $tipi = array("asd","222","dda","xcs"); $gun = … | |
Re: You have the right syntax. Just save your program as eigenValues3.js and then if you want to write a program that needs that file you just "import" it as follows: [code] <html> <head> <script type="text/javascript" src="eigenValue3.js"></script> <script type="text/javascript"> //The code that will use the functions in eigenValue3.js goes here </script> … | |
Re: You are currently doing: [CODE=javascript] if( conditions ) { ... required: true ... } [/CODE] If you look closer at your working example, your required is NOT true|false, it is a reference to a function that returns true or false. So, instead of what you have (and is not working) … | |
Re: A. at the end of line 17 you have [iCODE]horizontal[fishPos[fishNumber] [/iCODE]. That's a syntax error. You are missing a closing bracket after [iCODE]fishNumber[/iCODE]. B. On line 24 you have [iCODE]setInterval(fish1Swim, 100);[/iCODE], but there is no such thing as [iCODE]function fish1Swin(){...}[/iCODE] declared anywhere, so I don't see how you can claim … | |
Re: try: [CODE=html] <!-- make sure you put the [] at the end of the name --> <input name="searchterm[]" /> <input name="searchterm[]" /> <input name="searchterm[]" /> [/CODE] then try: [CODE=php] <?php //connect to the db first $conn=mysql_connect('...', '...', '...') or die(mysql_error()); mysql_select_db('...') or die(mysql_error()); foreach($_POST['searchterm'] as $i=>$v) { if(preg_match('#\w#',$v)) { $_POST['searchterm'][$i]=mysql_real_escape_string($v); … | |
Re: Load the page in your browser. Then view the source code. Within the source code look for: #D50512 That is the "red" color that you are seeing. | |
Re: If the XML file you are retrieving has invalid markup, then on line 20 [iCODE]xmlDoc[/iCODE] will be set to null. If that is the case, then [iCODE]xmlDoc.getElementsByTagName()[/iCODE] will give you the error you are describing. So, you need to make sure that the responseXML is not null. On your XML … | |
Re: before you begin the delay, try "capturing/recording" a reference to "[iCODE]this[/iCODE]" in some variable so that your delayed function actually knows what "[iCODE]this[/iCODE]" means: [CODE=javascript] $(".tabButton").click(function() { var self=this; $(self).css("background-color", "white").delay(500, function() { $(self).css("background-color", "black"); }) }); </script> [/CODE] | |
Re: try: [CODE=php] $result = mysql_query("SELECT * FROM comments") or die(mysql_error()); while( $row = mysql_fetch_assoc($result) ) { echo $row['alias'], ': ', $row['comment'], '<br />', PHP_EOL; } [/CODE] ![]() | |
Re: `<input name="name"... />` should be `name="username"... />`. You your comment: `// Set cookie / Start Session / Start Download etc...` is inaccurate. You need to start the session BEFORE you even begin sending any output. That means that you cannot start the session after you have send `<html>...` Try the … | |
Re: Check your file case. In other words, if your folder/file is named Style (uppercase "S"), make sure you are not using `< (...) href="../style/style.css">` (lowercase "S") | |
Re: try: [CODE=php] <?php session_start(); $redirectTo='http://yoursite.com/page.php'; $DEBUG=true; $SELF=basename(__FILE__); $err=''; $match=0; if(isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password'])) { $link = mysql_connect('localhost', 'username', 'password') or die('Could not connect: ' . mysql_error()); mysql_select_db('database') or die(mysql_error()); $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); $sql="SELECT `active` FROM `users` WHERE `username`='".$username."' AND `password`='".$password."'"; $search = mysql_query($sql) or … | |
Re: try: [CODE] <?php $datearray=explode('-','1980-09-28'); $days=str_replace('>'.$datearray[2],' selected="selected">'.$datearray[2],preg_replace('#option>(\d+)#','option value="$1">$1','<option>'.implode('</option><option>',range(1,31)).'</option>')); echo '<select name="day">'.$days.'</select>'; ?> [/CODE] |
The End.