-
Posts
94 -
Joined
-
Last visited
Never
Posts posted by Network_ninja
-
-
You maybe is looking for a rich text editor. try this: http://www.tinymce.com/
-
remove the <style> and <body> tags:
body { font-family: verdana; } .banner{font-size: 58px; color: #fff;} .top{font-size: 18px; color: red; } .body {font-size: 25px; color: green;}
-
The serverside scripts will need to check to make sure that time has expired everytime it is called to accept answer data.
what wud be the best ideal time to check? i am thinking if it is a good idea to run a serverside scripts to every seconds to check if time already expire?
-
ok. i understand ur advice. but how will i do it that there is a clock showing or a countdown timer and automatically locks the question sets after time expire?
-
Can someone show me the way? I am creating a online examination with time pressured. For example Part I of examination is only good for 20 mins. now if 20 mins is over it will be lock or good as submit. How will I do that?
tnx everyone.
-
make sure also that you have put return upon calling the function:
<input type='submit' name='submit' value='Submit' onclick='return jsfunction()' />
-
try. code igniter
-
add this code after your alert.
return false;
-
Or it coudl be done by having the laoder etc... pre coded on the page and have the CSS display set to none and if something hasn't happened ie XMLHTPP request is still loading via your get then show the loader, not too sure how to do this in jQUERY but javascript it is easy as, and rememer you can swap it about by putting javascript in jQuery. Hope that helps if I have understood ur issue correctly
this is the one I use and it's working. tnx for the reply, I was thinking that there is something like this is jquery but haven't found one.
if(document done executing the script) { display the result } else { show a preloader }
-
Tnx for the reply. Il try to read and read that link until I get it. The sample is very minimal, it's not very helpful though
-
Simple jquery get method:
jQuery(function ($) { $('.add_cashier').click(function (e) { var id = $(this).attr("id"); $('#basic-modal-content').modal(); $.get("ajax/cashier_entry.php?id="+id, function(data) { $("#basic-modal-content").html(data); }); return false; }); });
Hi that is my simple code to get data from cashier_entry.php and loads it in a div. My question is if it is still not ready to be load I want some preloader to display. Not just a blank page and waiting for the result to come out...
Tnx in advance.
-
Is there a way in php to not execute the whole script if there is error on the script?
For example:
<?php execute script here; .......... ........... [b] error encounter here[/b]. -> error is not logical execute script ............. ............. ?>
I don't want to execute the above script... tnx everyone.
-
tnx for the code. il try it out later.
-
Is anyone have a handy code that will format a number? both decimal and thousand separator?
eg. value = 1000.2532
result -> 1,000.25
tnx in advance
-
read about php error reporting
-
it's a notice. and it only means that you are accessing an uninitialize variable. eg... $_POST['username']
-
what the version of your IE? it works fine in my IE6
-
Just a wild guess. Is it a registration form or adding contents? and you would like to give warning to the user that if he/she navigates away from page the data will not be save?
then you can use what nogray provided. and for undesired result you could add checking if the content has a content and fire the javascript:
I'm talking about like this:
<html> <head> <title>Untitled Document</title> <script type="text/javascript"> window.onbeforeunload = function(){ var txt = document.getElementById("content").value; if(txt != '') { return 'are you sure you want to leave?'; } } </script> </head> <body> Type content here: <input type="text" name="content" id="content"> </body> </html>
Just a suggestion and wild guess.
cheers!
-
Did you try out the code? it's somewhat similar in your code. it's just that you are using AJAX and mine is Jquery-AJAX. As I experience if I use AJAX I cannot execute a javascript on the backend file, so I use the Jquery-AJAX.
have a look at this page:
http://www.w3schools.com/jquery/ajax_get.asp
http://api.jquery.com/jQuery.get/
Hav nyc weekend!
-
I also encounter that kind of scenario in one of my project so what I did is the first thing that I mention to you if possible. But if the case is similar to yours I used the code I provided to you. I am not pretty much sure why it cannot call a javascript that way, so most probably that will not also work.
-
Ok... You can try out this code if you want.
frontend.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.link1').click(function(){ var param = $(this).attr("id"); $.get("backend.php?param="+param, function(data) { $("#result").html(data); }); }); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $param = 'this is parameter'; echo "<a href='#' class='link1' id='$param'>Pls click me</a>"; ?> <div id="result"></div> </body> </html>
backend.php
<?php echo "The parameter you pass -- <b>". $_GET['param']."</b>"; echo "<script>alert('success');</script>"; ?>
I tested out that code and it's working the way you wanted it to be.
-
is it not possible to call the function after the script?
e.g:
<head>
<script language='javascript'>
function show_media_type(pub_type){
var url = "get_media.php?media_type=" + pub_type;
http.open("GET", url, true);
http.onreadystatechange = showmedia;
http.send(null);
alert('Hi');
}
function confirm_media(){
if(http.readyState == 4){
document.getElementById('header').innerHTML = http.responseText;
alert('Hi');
}
}
</script>
</head>
-
if you add this script your foo.html will be replace by bar.html ryt? but bar.html don't really exist in your directory.
var stateObj = { foo: "bar" };
history.pushState(stateObj, "page 2", "bar.html");
-
hello... follow up in my previous post.. I just get it on working. but my question is what if the user press F5? that page is not existing it will give a 404 error. what should I do?
mysql database update
in PHP Coding Help
Posted
change this line:
TO: