code wrong somewhere - JavaScript Help


hi,

this bit of Java is the put emoticons into a message box, it always puts them at the end of the message and not were the cursor is flashing, anychance someone can work this out please

var textarea; function addcode(code) { textarea = document.formsend.msg; if (document.selection) { textarea.focus(); var sel = document.selection.createRange(); sel.text = "["+code+"]" + sel.text + "[/"+code+"]"; } else { var len = textarea.value.length; var start = textarea.selectionstart; var end = textarea.selectionend; var sel = textarea.value.substring(start, end); var replace = "["+code+"]" + sel + "[/"+code+"]"; textarea.value = textarea.value.substring(0,start) + replace + textarea.value.substring(end,len); } }
Posted On: Wednesday 2nd of January 2013 12:40:52 AM Total Views:  337
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




IE8 related problem

whenever i go on submit the form with javascript function in IE-8 browser, it opens up a new window, what could be the possible reason for this
VIEWS ON THIS POST

111

Posted on:

Wednesday 21st November 2012
View Replies!

javascript

what is scriptingExplai the two types of scripting
VIEWS ON THIS POST

60

Posted on:

Wednesday 21st November 2012
View Replies!

setTimout function

I have this function delayLoad() function delayLoad() { setTimeout('window.open('test.swf','FacNews', 'width=303,height=757,left=1005,top=0')',3000); } test.swf is a flash file within the same folder. I am invoking this function using What am I doing wrong for this not to delay the load by three seconds I am having a system login that spawns a child window so I need to delay the window load of the swf so that it is on top. Its been years since I've done javascript, is there some other kind of methodology that I could possibly use
VIEWS ON THIS POST

202

Posted on:

Wednesday 21st November 2012
View Replies!

JS multiple popups

im working on programming a site to have several popups at the same time and i cant figure out where to put the second web link. iv been experimenting with throwing more links into the body section but i cant get a second popup to load. any tips on where im going wrong would be very helpful function popUp(URL1,URL2) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL1, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statu = 533,top = 234');"); eval("page" + id + " = window.open(URL2, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statu = 533,top = 234');"); eval("page" + id + " = window.open(URL3, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statu = 533,top = 234');"); }
VIEWS ON THIS POST

108

Posted on:

Wednesday 21st November 2012
View Replies!

Jquery Cycle Plugin

Could anybody help me with this problem... This is what my custom script for the Jquery Cycle Plugin (http://malsup.com/jq...e/browser.html) looks like. It's the "Cover" effect. var $cyc = jQuery.noConflict(); $cyc(document).ready(function(){ $cyc('#cycle').cycle({ fx: 'cover', timeout: 3000 }); }); Everytime I load the page from a fresh browser, the images that slide in are extremely small. I don't understand why this is happening. I took some screenshots of it. See.. But, when you reload the page.... Everything works normally. Take a look... Maybe it's the CSS\t Or Maybe it's the jQuery I dont know. If you want to see for yourself on the live website, Take A Look Here ...Anyone Please Help
VIEWS ON THIS POST

73

Posted on:

Wednesday 21st November 2012
View Replies!

JavaScript Slideshow

I am doing a slide show in javascript and need to center the slideshow. how do I do this
VIEWS ON THIS POST

179

Posted on:

Wednesday 21st November 2012
View Replies!

Check All Class

So I have create a function that is supposed to go through and find all elements of a certain class and either check them or uncheck them all depending on another checkbox's checked value. First my javascript function function check(obj,elmclass){ alert(elmclass);//used to debug but it doesnt pop up anything a = document.getElementsByTagName("input"); for(i=0,i
VIEWS ON THIS POST

53

Posted on:

Thursday 22nd November 2012
View Replies!

newbie needs cookie help

! Ok here is what I\tm trying to do: collect data from an html form and create a cookie containing that data, then have that cookie auto complete the form the next time someone returns to the site. Where I\tm at: Well unfortunately I\tm still stuck on getting the form data into the cookie. I cant seem to get the cookie to see the form data, the output is driving me crazy. What should be: "Your name is: your name" is returning as: "Your name is: [object]" The code: Ok so I\tm working on two pages one is writecookie.html and the other is readcookie.html Due to my continuing frustration I went back to the bare bones of the code and took out all extraneous lines, so this isn\tt even a real world example of what I\tm trying to do. I figure, if I can make this example work then I can carry over the solution to my actual application. --->writecooie.html Untitled Document readcookie.html Untitled Document function readCookie() { var the_cookie = document.cookie; var the_cookie = unescape(the_cookie); var broken_cookie = the_cookie.split(":"); var the_name = broken_cookie[1]; alert("Your name is: " + the_name); } What I've tried: Ok, from the code you can see I\tm using the Javascript DOM to reference the path to the text field in the form document.formname.formfield in this case: document.cookie_form.name other paths I have tried; document.cookie_form.name.value, doucument.cookie_form.name.text, document.cookie_form.value, window.document.cookie_form.name, document.cookie_form.elements[0].value, and document.cookie_form.elements[0] Im sure there have been others but I dont recall them right now If you can help, I would really appreciate it. Garrik
VIEWS ON THIS POST

195

Posted on:

Friday 23rd November 2012
View Replies!

Standalone Javascript interpreter for Linux?

I'm looking for a standalone Javascript interpreter like the ones of Perl and Python. Does such a thing exist for Linux
VIEWS ON THIS POST

86

Posted on:

Friday 23rd November 2012
View Replies!

Random pictures in each table data cell

, I am new to these forums, and I greet you all Here is the problem I am having. I have a 3x3 table, and I want to use the 6 bottom cells to display linkable pictures of merchandise. I ...
VIEWS ON THIS POST

236

Posted on:

Friday 23rd November 2012
View Replies!

About (function(){})()

It has been widely used nowadays to wrap JavaScript libraries, as seen in JQuery. (function() { var global = this; // ... })(); The advantage, as I learned, is the isolation from other global variables. But how What other advantages ...
VIEWS ON THIS POST

216

Posted on:

Friday 23rd November 2012
View Replies!

How to fade page

I want to make a button in my page "click here" when i click the page should fade and show some text.then u can close the text box.
VIEWS ON THIS POST

104

Posted on:

Saturday 24th November 2012
View Replies!

Onchange Select option how to display a another select?

Onchange Select option how to display a another select option
VIEWS ON THIS POST

118

Posted on:

Saturday 24th November 2012
View Replies!

JavaScript (Spartan) Property Toggler

!below is the code snippet This is a multi-use property toggler. In the given example we are toggling a sub property of an element. e -is the property owner to be targeted; p - is the property name to be set; v - is the property value; henceforward changing the class-name of the property owner instead; - would look like this: toggleProp(this,"className","newCls") meaning that the target element can delegate the behavior instruction to some other element, while the event itself can remain bonded to a simple on/off button, i.e.: toggleProp(reciever,"className","newCls") Works in all browsers, in all manners except Firefox v(9.0.1) when used on style properties exhibiting a randomly appearing bug already filed at [ Bugzilla@Mozilla Bug 720129 ], causing the toggle behavior to stop functioning in an toggle-on state.
VIEWS ON THIS POST

62

Posted on:

Saturday 24th November 2012
View Replies!

JQuery Username Validation

I'm new to JQuery and attempting to write a script to check username availability. My problem is that no matter what I type, I always get back "This username is already in use." JQuery source: $(document).ready(function() { jQuery.validator.addMethod("usernameCheck", function(username) { var isSuccess = false; $.ajax({ url: "username_availability.php", data: "username=" + username, async: false, success: function(msg) { isSuccess = msg === "TRUE" true : false } }); return isSuccess; },""); $("#register_form").validate({ onkeyup:false, rules: { username: { required: true, minlength: 3, usernameCheck: true // remote check for duplicate username } }, messages: { username: { required: "username is required.", minlength: jQuery.format("username must be at least {0} characters in length."), usernameCheck: "This username is already in use." } } }); PHP Source: include('database_connection.php'); if (isset($_POST['username'])) { $username = mysql_real_escape_string($_POST['username']); $check_for_username = mysql_query("SELECT user_id FROM users WHERE username='$username'"); if (mysql_num_rows($check_for_username)) { echo "TRUE"; } else { echo "FALSE"; //No Record Found - Username is available } } > HTML Source:  
VIEWS ON THIS POST

83

Posted on:

Saturday 24th November 2012
View Replies!

How to randomize the color...

How can i randomize the color of each cell using Math.ceil(Math.random()) this is the code: body { margin-left: 20%; margin-right: 20%; } h1 { font-family: jokerman; text-align: center; } td { border-style: outset; border-width: 5px; border-color: gray; font-family: courier new; } td:hover { border-style: inset; color:red; } Multiplication Table mess = "Please enter the number of rows ." do { x = window.prompt(mess); x = parseInt(x); mess = mess + "\nInvalid entry. Please try again." } while (x10) mess2 = "Please enter the number of columns ." do { y = window.prompt(mess2); y = parseInt(y); mess2 = mess2 + "\nInvalid entry. Please try again." } while (y10) document.write(""); for (i=1; i
VIEWS ON THIS POST

116

Posted on:

Saturday 24th November 2012
View Replies!

Convert this to Array

How do I convert the this object to an array. Please help me, many
VIEWS ON THIS POST

98

Posted on:

Saturday 24th November 2012
View Replies!

Enter an array of names, then sorting it!

Ok so first of all, your line var No = document.TEN.NoName.value; is called before you've typed anything into the box. If you want to use it properly, set it at the start of your INPUT() function. Also not sure why you're using N = eval(No); Are you looking for parseInt() maybe (Also should be in the INPUT() function.) But more importantly than those issues, your main issue is document.write. If you do that after the page is loaded(ie in your INPUT function),it will rewrite the whole page. So once you do that, you lose your headers, body, and even all your scripts/variables. So you can either rewrite the whole page in that function, or use something like document.body.innerHTML=... function INPUT() { No = document.TEN.NoName.value; N = parseInt(No); var bText = ""; var i; for(i=0; i
VIEWS ON THIS POST

258

Posted on:

Saturday 24th November 2012
View Replies!

Scrollable table

I want to create a simple table in js from array. I want to retrieve records as user scrolls. I donot want to use paging. So please any one help me about this. Give me a simple example.
VIEWS ON THIS POST

87

Posted on:

Saturday 24th November 2012
View Replies!

How to make the following form ?

:) I Form in this site http://in.linkedin.com/ that when you click Submit and "or Cancel" disappears and in its place appears loader image :)
VIEWS ON THIS POST

145

Posted on:

Sunday 25th November 2012
View Replies!

onsubmit is not working in form

Ok, let's roll up the sleeves. Remove the jquery files that you are not using. jQuery is grabbing control. I suspect the jquery form script. Start with it and keep going. the thing should function without jquery. Other stuff may not.
VIEWS ON THIS POST

137

Posted on:

Sunday 25th November 2012
View Replies!

Dynamic iFrame height, not working in ie without refresh.

When i try to dynamically change the height of an iframe in ie through a java-script to match its content (a html page containing a flash movie), it doesn't resize the iframe at first, but when i reload the same page into the iFrame it resizes as planned, how come Any ideas This script works well in firefox, safari and netscape, but i cant get it to work in ie(8, 7). And i get the same problems with every resizing script i've tried. This is the script i use: The iframes: IFRAME> I have a flash menu in the first iframe, the buttons on the menu uses getURL(siteToLoad, "contents") to load another html-page into the iframe "contents". Is it possible to make the iFrame refresh automatically though javascript so that i just refreshes the iframe once Everytime ive tried that it just ends up in a never ending refresh-loop... How can i make this work Is there any better script for resizing (and refreshing after resize) the iframe height so that it matches to its content Please, i've been stuck with this problem for some days now... // Max
VIEWS ON THIS POST

245

Posted on:

Sunday 25th November 2012
View Replies!

banner in ajax

Hi all.. i want to create a banner in my website using asp.net and ajax.. banner will consist of many banners and have the paging under the banner that moving y itself.. what we call it i cannot find any other example yet because i dont know the name of that application..
VIEWS ON THIS POST

217

Posted on:

Sunday 25th November 2012
View Replies!

Problem with iFrame function in IE

, So I have a small Flash application that plays a sound when a new message is received in a chat-box. The flash player is on a page embeded with an iframe. In the parent window, a variable called new_message is used to keep track of wether it is a new message or not if ( new_last_message != last_message ) { last_message = new_last_message; new_message = true; } Then code within the iFrame checks this, if it is a new message then it plays the sound function run_sound() { getMovie('viewer').new_msg(); } function getMovie(movieName) { if (navigator.appName.indexOf("Microsoft") != -1) { return window[movieName]; } else { return document[movieName]; } } function check_new() { if ( parent.new_message == true ) { if ( parent.first_load == true ) { parent.first_load = false; parent.new_message = false; } else { parent.new_message = false; run_sound(); } } //alert('Running Subfunction'); setTimeout('check_new()', 100); } It works fine in every browser except IE which gives me the error Object Doesn't support this property or method refferencing line 309 of the file ( getMovie('viewer').new_msg(); ) Why is it only doing this in IE, it works fine in Safari, Firefox and Chrome The chatbox can be viewed at http://forum.dftba.com/ (You need to have signed in but the accounts are free)
VIEWS ON THIS POST

83

Posted on:

Sunday 25th November 2012
View Replies!

I need two functions in one click! (jQuery)

, I'm building an intranet site for work with an autocomplete feature. I have it working to where when the user clicks on the name in the autocomplete list, it will fill that value to the text input box. What I need it to do is after it fills in the value, also submit the form, la Google. I would usually research how to do this, but I'm on a tight schedule and really need your help! Here's what I have for the code so far. function suggest(a) { if (a.length == 0) { $("#suggestions").fadeOut() } else { $("#search").addClass("load"); $.post("autosuggest.php", { queryString: "" + a + "" }, function (b) { if (b.length > 0) { $("#suggestions").fadeIn(); $("#suggestionsList").html(b); $("#search").removeClass("load") } }) } } function fill(a) { $("#search").val(a); setTimeout("$('#suggestions').fadeOut();", 300) };
VIEWS ON THIS POST

122

Posted on:

Sunday 25th November 2012
View Replies!

jQuery onclick background change

I'm trying to get it so table cells within a row that are clicked on changes the background colour. HTML code: World World 2 World World 2 World World 2 Script code: $( function() { $('td').click( function() { $(this).parents('table').find('td').each( function( index, element ) { $(element).removeClass('on'); } ); $(this).addClass('on'); } ); } ); The stylesheet has a .on class that changes the background colour when clicked. It's working fine at the moment, but I'm trying to get it where multiple cells can be clicked and background changed, but only one cell per row. I figure I need some classes within the tr/td tags in the table but not entirely sure the script code to work it, googled quite a few different things but not come across anything yet. Any ideas appreciated.
VIEWS ON THIS POST

130

Posted on:

Monday 26th November 2012
View Replies!

animate() rectangle with jQuery

Hi all I'm trying to have some jQuery movement on my HTML page. I have a div that I want to move from right to left, and another one from left to right. This is what I did: #rectone { background: #0000FF; height: 10px; width: 100px; float:right; position: absolute; top: 0; right: 0; margin-top:5%; } #recttwo { background: #00FF00; height: 10px; width: 100px; float:left; position: absolute; top: 0; left: 0; margin-top:7%; } $(document).ready(function(){ $(".run").click(function(){ var left = $('#rectone').offset().left; $("#rectone").css({left:left}).animate({"left":"0px"}, "slow"); }); }); Run This is the right to left movement, but I can't figure out how to move the other box from left to right. Some hints
VIEWS ON THIS POST

101

Posted on:

Monday 26th November 2012
View Replies!

call a javascript function in html

! I wanna pass the value returned by a javascript function to a variable that will be GET-ed by a php file. So this is the code Adauga consultatie and it does not work it passes me just that : javascript:retCNP(), instead of the return value of the function. So how can I do it
VIEWS ON THIS POST

169

Posted on:

Monday 26th November 2012
View Replies!

navigation menu in javascript

Quote , I am having a problem with my navigation menu; when a user clicks on a button (ex. About Us) the page is displayed as a pop-up (i.e. a new window pops-up). What I would like is have the contents displayed on the sites main page; each time the user click a button the contents are displayed right there on the main page...NOT it's own individual window. I have attempted many things and still cannot seem to get it to work. I am a beginner so perhaps its my novelty that's the problem. ....any help at all will be so greatly appreciated!!!! Below is my code (html + JS and css)---essentially where the flyer is located is the main page...that is where I would like each page to load onto.
VIEWS ON THIS POST

86

Posted on:

Monday 26th November 2012
View Replies!

Please help me your analysis?

document.write("") function showtip(w){ if(navigator.appName=="Netscape") { return false; } var x=event.x; var y=event.y; tip.innerHTML=w; tip.style.visibility="visible"; tip.style.left=x+10; tip.style.pixelTop=y+document.body.scrollTop+10; } function hidetip(){ document.getElementById("tip").innerHTML="" //tip.style.innerHTML="" document.getElementById("tip").style.visibility="hidden"; } Mod Edit: Please use code tags when posting your code. Code tags are used like so =>
VIEWS ON THIS POST

125

Posted on:

Monday 26th November 2012
View Replies!

Best RIA framework performance

Hi ,, I'm planning to start doing editor web application for my final year project , now i have to decide which RIA framework to use , i have no problem to adopt any new language and i love to learn more :D , i have seen GWT but the performance i don't think is enough sufficient , also jQuery but they don't have much widgets , finally i have seen Adobe FLEX which has a great performance so what think about it
VIEWS ON THIS POST

116

Posted on:

Monday 26th November 2012
View Replies!

Help needed PLEASE update database on browser close

I am working on a chat program. When a user logs in, a value in the database is set to 1 (online), and when he/she logs out it is set to 0 (offline). The problem is, when the user exits the browser, naturally the value is still set to 1. I was wondering if it is possible using AJAX or otherwise to update the database on the event of browser close I have tried onbodyunload in the body tags pointing to a file with a JavaScript function containing the PHP code (query to update the field) but cant get it to work. If anybody has any advice, please help me it is driving me mad and is the biggest problem standing in my way to get the app to work..
VIEWS ON THIS POST

113

Posted on:

Monday 26th November 2012
View Replies!

Text from Text area to be used in scroll

Hi! I'm in the process of creating a web page wherein there is a small section wherein some text are scrolling from bottom to top. Now out of this section in the main page, I wish to create a text area for user to fill-up and first few words of their contents should appear on the scrolling text as a link for whole text contents when clicked. Could anybody help on these lines.
VIEWS ON THIS POST

107

Posted on:

Monday 26th November 2012
View Replies!

get caret coordinates

Hi: I'm trying to set a dropdown autosuggestion inside a textarea or a rich textarea (iframe+designmode). The problem I found is that I don't know how to get the caret coordinates in gecko-based navigators. In MSIE, the caret coordinates seems to be gotten by offsetTop and offsetLeft applied to the selection, but in documented Gecko DOM documentation does not appear something simmilar to that. anchorOffset or startOffset return the character postion but not the coordinates. Anyone know how to get it
VIEWS ON THIS POST

124

Posted on:

Tuesday 27th November 2012
View Replies!

Redirect page function problem with Firefox browser

Hi everybody, I am using a java script function which redirect to the page according to the given parameter, and it is working as deed in IE, but I found that it not work with Firefox browsers, so some one plz guide me how it is possible to have the same function which could work on IE and Mozilla firfox. The function code:
VIEWS ON THIS POST

144

Posted on:

Tuesday 27th November 2012
View Replies!

JAvascript Image - JavaScript Help

hi friends im new in this forum . i have a question my question is that in gogole map api we can click on a map and place a marker on that postion . how can i do that in a simple image when i was click on image and place marker on that postion \t is that possible in javascript \t
VIEWS ON THIS POST

71

Posted on:

Tuesday 27th November 2012
View Replies!

Submit form with JS - JavaScript Help

I am dynamicly generating multiple forms to submit the complete path to an image. I am using the JS document.formname.submit(). After clicking on the image text link, I get the error message that "document.name is null or not an object or undefined".\tI have viewed the source page and the forms have the correct name with the image.\tDid a print on the form name passed to the JS goForm and it displays the correct form name
VIEWS ON THIS POST

106

Posted on:

Tuesday 27th November 2012
View Replies!

setInterval and objects

On Nov 10, 3:58 pm, Jeff wrote: > I've been trying to pass in an object in a setInterval but it > complains about missing ] after elenment list. > > setInterval("someFunction("+some_object+")",1000); > > What's the correct syntax to ...
VIEWS ON THIS POST

100

Posted on:

Friday 30th November 2012
View Replies!

Long JavaScript processes prevent animated GIFs animation

, I am working on some JavaScript, that amongst other things does searches in an index. The search can take a couple of seconds, and I would like to disable the form button that the user clicked to trigger the ...
VIEWS ON THIS POST

104

Posted on:

Friday 30th November 2012
View Replies!

FAQ Topic - Which newsgroups deal with javascript?

----------------------------------------------------------------------- FAQ Topic - Which newsgroups deal with javascript ----------------------------------------------------------------------- The official Usenet newsgroup dealing with javascript is comp.lang.javascript. There are other newsgroups but many of them are not carried by most news feeds. clj is an unmoderated newsgroup. === ...
VIEWS ON THIS POST

73

Posted on:

Friday 30th November 2012
View Replies!

Re: Please read - nothing nasty

Not you again. I think this is a little bit off topic here. Your url link does not work, your English is poor, you are being annoying. Please, get a life and stop posting. Why have you posted this to ...
VIEWS ON THIS POST

70

Posted on:

Friday 30th November 2012
View Replies!

Using Javascript to change a table

I would like to use the equivalent commands of 'onEnter' and 'onLeave' to change the background of cells in a table. Can anyone tell me if there is a simple method of doing this. How can I tell which cell ...
VIEWS ON THIS POST

157

Posted on:

Friday 30th November 2012
View Replies!

show popup window at the center of the screen

how to display the popup window at the center of the screen....
VIEWS ON THIS POST

74

Posted on:

Friday 30th November 2012
View Replies!

Sortable Width - JavaScript Help

Hi ,I am using this code to allow me to swap divs of different heights.http://jsfiddle.net/ryleyb/Y5fzX/1/However, I also want to apply it to divs of different widths, so I can do something like:http://www.askvg.com...other-browsers/(only live example I can find that sort of shows what I am trying todo.)So if anyone can help me with this, that would be much appreciated.Cheers in advance :)
VIEWS ON THIS POST

150

Posted on:

Friday 28th December 2012
View Replies!

Animate then Change CSS - jQuery - JavaScript Help

How can I animate a function and then change the same properties with css\t Right now I am using....$('#wrapper').animate({ scrollTop: $("#arrow_down").offset().top, height: "600px", marginTop: 189 - doc_height + "px"}, 1000, 'easeInOutCirc', remove_btn_down());Then when the window resizes I want to adjust the margin but these margins keep conflicting and cause the screen to flicker. The animate margin is usually the more dominant force. $(window).resize(function() { window_height = $(window).height(); doc_height = $(document).height(); if($('#arrow_down').hasClass('arrow_up')){ var new_margin = 1171 - doc_height; $('#wrapper').css({marginTop: new_margin + "px"}); } });
VIEWS ON THIS POST

134

Posted on:

Friday 28th December 2012
View Replies!

photo gallery - JavaScript Help

,I'm not quite the hero in javascript, I only know PHP and even that isn't magnificent. However, I managed to make a photogallery system with PHP and MySQL. Here's the code:elseif(mysql_real_escape_string($_GET['fx'] == 'photos')) { if(!isset($_GET['sub'])) { echo 'Kies een album!'; echo "http://localhost/chi...#039;>Chirokamp 2010"; } elseif(!isset($_GET['sub2'])) { if(CleanMyDirtyData($_GET['sub']) == 'chirokamp2010'){$albumpubliek = 'Chirokamp 2010';}else{$ambumpubliek = CleanMyDirtyData($_GET['sub']);} echo "Album: $albumpubliek"; $album = CleanMyDirtyData($_GET['sub']); mysql_select_db('db'); $query = mysql_query("SELECT * FROM albums WHERE album='$album'"); $i = 0; echo ""; while($row = mysql_fetch_assoc($query)) { if($i == 5 || $i == 10 || $i == 15 || $i == 20 || $i == 25){echo "";} echo ""; echo "" . ""; echo ""; $i += 1 ; } echo ""; } else { mysql_select_db('dyfemtaw'); if($_GET['sub'] == 'chirokamp2010'){$albumpubliek = 'Chirokamp 2010';}else{$ambumpubliek = $_GET['sub'];} echo "Album: $albumpubliekhttp://localhost/chi...010'>Terug naar overzicht"; $photoid = CleanMyDirtyData($_GET['sub2']); $album = CleanMyDirtyData($_GET['sub']); $query = mysql_query("SELECT * FROM albums WHERE album='$album' AND photoid='$photoid'")or die(mysql_error()); $row = mysql_fetch_array($query)or die(mysql_error()); $photonumber = $row['id']; $previous = $photonumber -= 1; $query2 = mysql_query("SELECT photoid FROM albums WHERE album = '$album' AND id='$previous'"); $row2 = mysql_fetch_array($query2); $previousid = $row2['photoid']; $next = $row['id'] += 1; $query3 = mysql_query("SELECT photoid FROM albums WHERE album = '$album' AND id='$next'"); $row3 = mysql_fetch_array($query3); $nextid = $row3['photoid']; //getting last id $query4 = mysql_query("SELECT id FROM albums WHERE album = '$album' ORDER BY id DESC LIMIT 1"); $row4 = mysql_fetch_array($query4); if($previous == 0) { $firstcell = ""; $fourthcell = $row['explanation']; if($next == $row4['id'] += 1) { $thirdcell = ">>"; } else { $thirdcell = "http://localhost/chi...tid'>>>"; } echo "$firstcell$secondcell$thirdcell$fourthcell"; } }Quick explanation; the url is of the form index.phpfx=photos&sub=album&sub2=photoid. When there is no photoid set, it shows a gallery of all the pictures, little transparant, and when you hover it is 100% visible. When you click on an image, you go to the photoid. So the whole page reloads with a 'sub2' in the url added.If the sub2 is set in the url, you go to a page with one picture in the center, and then on the sides buttons to go to the next photo or previous photo. Now this is done with a new link, all the same except the photoid. So the whole page reloads.Now what I want is to get this done with javascript/ajax. So that if you click to go to the next image, solely the image gets reloaded. Like this the site must load less, and if the page is too big for the user - he needs to scroll down to see the image - he mustn't rescroll every time.I'm really new to javascript and ajax, though I believe it is the future, so please explain very well, or give a well documented link.On a sidenote; for the next and previous image, I use the 'id' in the database of the picture. But if I remove one picture, the whole thing is messed up! How is this mostly done, what is stored in a database,...
VIEWS ON THIS POST

113

Posted on:

Friday 28th December 2012
View Replies!

F F A Linked Web Page Frameset scripting error - JavaScript Help

:rtfm: :confused:I am having a hard time converting the FFA Scripts 3.0 files from Softopedia to a Linked Web Page Recorder. I imagine using frames to submit page URL after page URL, and perhaps even PDF images, to an old Coblat RAQ.Heres the jist, I did some of the organization (Even started and Open Standards Treasury Databanking foundation) 8), and am having a hard time getting a URL cross read from a frame set WWW browsing area with a toolbar, and posted in.function URLString() {document.forms["form1"].URL.text = document.getElementById("linkingframe").src}......Free for Linking by Rich
VIEWS ON THIS POST

76

Posted on:

Monday 31st December 2012
View Replies!

jQuery .append help - JavaScript Help

,I'm trying to create a button that will put text into a . I've got this half working, so when I press the Button it puts in [B][/B] However, if I delete that or type something else, when I press the button again, it does nothing.Could anyone help $('#bbcode_bold').click(function() { $('#topicMessage').append('[B][/B]'); });
VIEWS ON THIS POST

55

Posted on:

Tuesday 1st January 2013
View Replies!

this.type=password - JavaScript Help

I have a text field, and when a user clicks on it, it turns into a password field.to accomplish this, I have this in an onfocus method in the input:This works perfectly fine in Firefox, but in Internet Explorer, I have an error message saying: Quote Could not get the type property. This command is not supported.How can I fix this in Internet Explorer , still not solved , genius,
VIEWS ON THIS POST

105

Posted on:

Wednesday 2nd January 2013
View Replies!

Body onkeypress - JavaScript Help

I want to display a messgae (alert) whenever anyone click space in my webpage. Now, is there any way to do this other than putting the onkeypress in BODY tage Can I put onkeypress in any other place and have the same result
VIEWS ON THIS POST

298

Posted on:

Wednesday 2nd January 2013
View Replies!