1,330 Posted Topics
Re: It's possible that some server directive has been altered (or your site has been rehosted), and [ICODE]file_get_contents($url);[/ICODE] is no longer retreiving file contents, particularly if the file is served from a different domain. If so then you need to speak with your hosting company/server admins. [B]Airshow[/B] | |
![]() | Re: I'm not sure I fully understand but here's what I know: To hyperlink a page into the "body" frame from the "header": <a href="myPage.jsp" target="body">xxx</a> If you need to pass parameters then: <a href="myPage.jsp?a=1&b=2&c=3" target="body">xxx</a> Server-side just do whatever is necessary with regard to redirection and usage of the parameters. … |
| |
Re: Solomon, I think the problem is that the javascript is crashing before it's done anything. There's a double [ICODE]}[/ICODE] at the end of the function where there should be just one. That should fix it, but of you're interested in a technique that avoids setting a global, then try this … | |
Re: You could simply set up a couple of associative (hash) arrays and use them to look up "coded" values: [CODE=php] $categories = array( 'a' => 'cat', 'b' => 'dog', 'c' => 'orange', 'd' => 'apple' ); $subcategories = array( 'a' => 'carpet', 'b' => 'wardrobe', 'c' => 'door', 'd' => … | |
Re: Pbpyrojust, The answer will lie in where you set [ICODE]$yes[/ICODE] and [ICODE]$no[/ICODE]. Could you post the code? [B]Airshow[/B] | |
Re: psyb0rg, Ajax is indeed the way to go. First some javascript: [CODE=javascript] function createRequestObject(){ if(window.XMLHttpRequest) { return new XMLHttpRequest(); // IE 7, Firefox, Safari, Opera... } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); // Internet Explorer 6, 5 } else { alert('Problem creating the XMLHttpRequest object'); } return false; } function … | |
Re: Your data is now two levels deep so you ned nested loop in your onsuccess handler to access it. It will be something like: [CODE=javascript] $H(emptyAssociativeArray).each(function(player) { $H(player).each(function(pair) { $('workaroundOutput').insert('<div>' + pair.value + '</div>'); }) }); [/CODE] You may need to check the Protoype API to see if $H(...).each works … | |
Re: usmanabb, What size is the original in px? It's hard to tell from the way Daniweb serves image attachments. [B]Airshow[/B] | |
Re: My immediate thought is that you could md5(innerHTML onload) your div's and store the reult (as a JavaScript variable). Then, whenever you need to know if the div's contents have changed, compare md5(current innerHTML) with the stored md5. Md5 would be a cheap way to store a representation of innerHTML … | |
Re: Asknight, The contructor function [ICODE]Slider[/ICODE] contains a strange mixture of ideas! Chiefly, [ICODE]sliderEngine[/ICODE] is global and is an instance of [ICODE]Slider[/ICODE], but [ICODE]Slider[/ICODE] refers to [ICODE]sliderEngine[/ICODE] internally where (I guess) it should use [ICODE]this[/ICODE]. [ICODE]$[/ICODE] and [ICODE]dc[/ICODE] are set within [ICODE]Slider[/ICODE] but without a leading [ICODE]var[/ICODE], hence they are global. … | |
Re: Xessa, This is very simple, though maybe not obvious. First create a funtion in your main page [CODE=javascript] function popUpCallback(x){ var b = document.getElementById('b1');//the button that you want to hide/show if(b) { b.style.display = (x) ? 'inline' : 'none'; } //Add/modify this function to do whatever you want in the … | |
Re: Whitestream, [QUOTE=whitestream6;941891]I'm trying to get the code so that the URL is similar to these: [url]http://www.autoweek.nl/carbase_data.php?id=45405&cache=no[/url] [url]http://library.digiguide.com/lib/programmenextshowing/238308&hPage=2[/url] where the query string has multiple parameters.[/QUOTE] Your url can't be similar to both of these examples. You must choose one or the other, and unless you want to make a lot of … | |
Re: Rhino, Your version-3 is fine because you are aligning text. The issue with text-align and block elements (not just <div>) is that the various browsers render differently if you try to use [ICODE]text-align:center[/ICODE] or [ICODE]text-align:right[/ICODE] to control the position of a block element itself within a wider, containing block element. … | |
Re: I'm not sure I fully understand. Do you want a 2-level (or n-level) hierarchy of buttons (ie. buttons organised into groups)? If so then Ajax is overkill. You could download the whole button hierarchy as a set of nested javascript objects, together with a set of routines for displaying & … | |
![]() | Re: AH, You can try this: [CODE=javascript] onload = function(){ var s = document.getElementById('mySel'); s.onchange = s.onblur = function(){ this.style.width = '150px'; }; s.onmouseover = function(){ this.style.width = '310px'; }; } [/CODE] [CODE=HTML] <select id="mySel" style="width:150px;"> <option>Option a</option> <option>Option b</option> <option>Option c</option> <option>Option d</option> <option>Option e</option> <option>Option f</option> <option>Option g</option> <option>Option … |
Re: deleti0n First, by passing a second parameter to your functions, you make them more flexible, and you can get rid of "decrement" because it is just "increment" with a negative value. Then, there's a number of ways to do the sequence. There are three below, in increasing order of complexity … | |
Re: You could try [code]var screen = document.getElementById[COLOR="Red"]([/COLOR]'newComponentDetailsEntryForm'); screen.[COLOR="Red"]setAttribute('action', "<%= request.getContextPath()%>/" + "newComponentDetailsEntryViewAction.do")[/COLOR]; screen.submit();[/code] [B]Airshow[/B] | |
Re: aJasmine, Shawn is right, and the [URL="http://docs.jquery.com/Ajax/jQuery.getJSON"]jQuery Documentation for jQuery.getJson[/URL] confirms it : "Note: Keep in mind, that lines after this function will be executed before callback." Hence, if you want to do something, reliably, with the Json response, then it needs to be stimutated (or enabled) within jQuery.getJson's callback … | |
Re: Genesistr, Inheritance in JavaScript is a pretty large subject and in all probability not at all like what you're used to in other languages. What ever else you read on the subject, you must read these - both by the master, Douglas Crockford: [URL="http://javascript.crockford.com/prototypal.html"]Prototypal Inheritance in JavaScript[/URL] [URL="http://javascript.crockford.com/inheritance.html"]Classical Inheritance in … | |
Re: MoreCrab, You're in the wrong forum, but here's the answer: [CODE=HTML]<table class="thickBorders"> <tr><td>Name</td></tr> </table>[/CODE] [CODE=css] .thickBorders { border:thick; border-style:outset } [/CODE] [B]Airshow[/B] | |
Re: Whitey, This is very confused! From the user perspective, what are you trying to achieve? [B]Airshow[/B] | |
Re: Kako, Easiest way is to use an <a> tag: [CODE]echo "<a href="$path" target="_new">Click Me</a>";[/CODE] You can use <button> if you want but you then have to use window.open etc. etc. because <button> was included in the HTML spec for form submission as an alternative to [ICODE]<input type="button">[/ICODE], [ICODE]<input type="select">[/ICODE] or … | |
Re: Shaiss, The function will simplify to this: [CODE]function BuildQueryString($orderNumber, $order_detail){ $prodURL = array("OrderNumber=$orderNumber"); for($i=0; $i<count($order_detail); $i++){ $prodURL[] = "SKU" . ($i+1) . "=" . $order_detail[$i][2]; $prodURL[] = "Qty" . ($i+1) . "=" . $order_detail[$i][3]; } return implode('&', $prodURL); }[/CODE] I've not tested but this should work within itself. It's overall … | |
Re: Bhilal, There are essentially two techniques (with thousands of variations) for loading/reloading part of a "page": [LIST=1][*]Frameset/iFrame [*]AJAX[/LIST] Full descriptions are beyond the scope of a Danweb answer. Try googling these terms with the word "tutorial". You should get loads of results. [B]Airshow[/B] | |
Re: Kako, Divs are not layers. They are general purpose block elements - ie, they are rectangular and stack vertically on the page [ in the y (height) dimension not z (depth) ]. Netscape implemented an HTML <layer> element but it is now well and truely obsolete. Like other HTML elements … | |
Re: Arunajasmine, I agree with lordSpace that composing the table server-side would be the easiest thing if (a) the server-side script is under your control and (b) you don't need to access the tabulated values for any other purpose. If you want/need to build the table client-side then try this: [CODE] … | |
Re: Progtick, That looks like an ASP custom attribute. If so, then you're in the wrong forum. Suggest you ask in "ASP". [B]Airshow[/B] | |
Re: Sonia, You might like to try something like this: [CODE=javascript] //This is a general utility function that returns an Initial Caps version of the input string function initialCaps(str){ var a = str.split(' '); for(var i=0; i<a.length; i++){ ch = a[i].charAt(0); a[i] = a[i].replace(ch, ch.toUpperCase()); } return a.join(' '); } //This … | |
Re: Fakhrizaki, In my experience div {display:inline;} is ineffective and/or unsafe. Suggest you purge if possible. See style="..." at lines 71 & 79. Apart from that it's hard to say what might be wrong. The good news is that the page appears to behave itself in FF 3.0.11 under Win2000, screen … | |
Re: Star69, At lines 28(x2), 34 and 36 you have apostrophes, which are the same character as single quote, therefore muchos confizion. You must either put the string in [ICODE]"double quotes"[/ICODE] or escape all apostrophes like this - [ICODE]Owner's[/ICODE]. [B]Airshow[/B] | |
Re: Osirion, You don't need to use a hidden field for this. You can test to see which submit button was clicked in JSP. The clicked button will appear in the POST parameters - the other two won't. I can't remember the syntax in JSP but I'm sure you know that. … | |
Re: Lurker, Personally I choose not to set what are effectively "labels" as field values. The reason being that once a value has been entered, the "label" is no longer available to be seen by the user. He/she is thus denied full confidence when doing a last scan of the form … | |
Re: Napster^2, Not sure but it may be [ICODE]var xmlhttp = new GetXmlHttp();[/ICODE]. Typically GetXmlHttp() would return an xmlHttpRequest object, so [ICODE]new[/ICODE] would not be required in the call. Of couse I can't tell for certain without seeing the GetXmlHttp function but it's possible that FF is sensitive to this. [B]Airshow[/B] | |
Re: "during processing" ? | |
Re: Vtek, Are you editing in MS Word? Guaranteed grief. Use notepad, or my favourite 1st Page 2000/2006 by [URL=http://www.evrsoft.com/]Evrsoft[/URL] [B]Airshow[/B] ![]() | |
Re: Whitey, [ICODE]$myDirectory = opendir(".");[/ICODE] is indeed the line that determines which directory is listed. If you want to list some other directory then it depends on where it is relative to the php script location. You need something like: [LIST][*][ICODE]$myDirectory = opendir("./myDir");[/ICODE] (a dir within the current dir) [*][ICODE]$myDirectory = … | |
Re: Best thing would be to purge floats completely but that seems not to be possible because (inexplicably) you lose control of height and width of the li/a elements, at least in IE6 and hence lose some of the visual effect. Try this: [CODE=css]#menu { background:url("images/menubg.gif") repeat-x top; height: 163px; margin-bottom: … | |
Re: Gackerman, You could use an inline style like this: [CODE=html]<div dojoattachpoint="_embedGroupButton" class="embed_group button" style="display:none">Embed</div>[/CODE] or put the style in a style sheet: [CODE]<style type="text/css"> .embed_group button { display:none; } </style>[/CODE] As this would apply to all elements with [ICODE]class="embed_group button"[/ICODE], you could alternatively give the element an id as follows: … | |
Re: Beko, Assuming you want fixed width content of 750px, try the following css: [code=css]#alignment { width: 750px; position: relative; left: 50%; margin-left: -375px; }[/code] [I](add further directives as required)[/I] I can't really explain your horizontal scroll bar but can only assume it's caused by some wide content (maybe an img, … | |
Re: Or use [ICODE]method="get"[/ICODE] instead of [ICODE]method="post"[/ICODE] to pass request parameters when the page is originally requested. [B]Airshow[/B] | |
Re: Bakshi, In your forst paragraph you say, "the chosen data then needs to be stored and saved in a xml file". Where exactly do you intend this file to be saved and can you post the code that is supposed to perform the save? [B]Airshow[/B] | |
Re: BBQKaren, First and foremost - Javascript and Java are completely different languages. Google "java versus javascript" for many detailed discussions and explanations. For your problem, you need code not only to hide the tables initially, but also to generate the +/- controls. Otherwise the small minority with javascipt disabled will … | |
Re: Drago, So what behaviour do you get in IE? It's hard to disgnose without knowing the symptoms. [B]Airshow[/B] | |
Re: Taking Essential's suggestion one very small step further, you can avoid using a global variable by tucking the [ICODE]setInterval[/ICODE] reference away somewhere other than the global namespace - for example as an attribute of the "time_now" document element, like this; [CODE=javascript]$(document).ready(function(){ //Paleidimo funkcija var time_ref = setTimeout(function(){ $('#time_now').attr({ t_ref : … | |
Re: Lolalola, As far as I can tell, an IE XMLHTTP request is a one-shot affair whereas in Moz it will work many times over. As such, there is little point in making your "http" global. It can (and should I believe) be declared within [ICODE]sendRequest()[/ICODE] with [ICODE]var http = createRequestObject();[/ICODE]. … | |
Re: Aaaaaaaaagh!!!! Did I hear a distant pop? I think ShawnCPlus just burst a blood vessel. [B]Airshow[/B] | |
Re: Chorcho, I can think of two solutions. Unfortunately I'm sure that neither is what you want to hear! 1. Use a regular JPG, GIF or PNG in place of the .swf. You can achieve very similar mouseover effects with an image map and dhtml mouseover handlers. GIFs and PNGs can … | |
Re: Dwrakh, I can't offer you any code (it would take me between a week and a month to code this up) but I can explain in principle how to go about it. Devlop a Chess class in a server-side web language such as PHP. This class will include a data … | |
Re: Mmmmm, hard to say. Is there an independent page for each of the two tabs or one "template" page? If the pages are independant then look for differences in the structure and CSS of all containing elements from body down to the calendar element. If the pages arise from a … |
The End.