-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Just a see a load of error messages.
-
I thought you were trying to style a button to look like a link? Anyway.. I'm unable to recreate the behaviour you mentioned in my version of FF (3.6.15), but I imagine it's down to specifying both the left and right attributes. Remove "right=30" and you should be fine, though your code is broken at the moment for non-JS users. Quick fix:
-
Need help with resizing table column on TinyTable V3
Adam replied to geekisthenewsexy's topic in Javascript Help
Was surprised to see jQuery DataTables didn't support column re-sizing, but you may still be able to get a plug-in for it by the looks of things. I've heard of Flexigrid before, which does support column re-sizing, but unable to vouch for it as I've never used it. If you don't have much JavaScript knowledge though the last thing I'd suggest would be to try and modify the script yourself, and I doubt you'd find someone willing to do it for free here I'm afraid. -
jQuery Change Handler To Change php session data
Adam replied to Xtremer360's topic in Javascript Help
And the problem is..? -
It's a little messy having the SQL within the function like that, separate it into a variable and you'll probably find it easier to work out the syntax in future. In this case, you just need to re-open the string after the variable and add the order by clause: $sql = "SELECT * FROM company_people WHERE company_id = " . (int) $company_id . " order by name"; [...]
-
WAMP server must not have MSSQL support by default. This post appears to offer a solution (scroll to the last post), but there's no reply after so can't say if it works or not. Should be able to find something else on Google if not though.
-
Hi any one know how Anchor tags are becoming input boxes
Adam replied to takn25's topic in Javascript Help
You should define the input within/as a hidden element, then display when you capture the click event on the anchor. You should always provide a non-JavaScript version though, so you would either use JavaScript to hide the element as the page loads, or ensure that the anchor's href works to provide non-JavaScript support. I'll give you some example code for the first solution... In the HEAD: <script type="text/javascript"> window.onload = function() { document.getElementById('target_anchor').onclick = function() { document.getElementById('input_block').style.display = 'block'; } } </script> This will wait for the page to finish loading, then assign a function to the click event of the #target_anchor element - that function will handle displaying the element. Assigning the events this way is part of what unobtrusive JavaScript is all about, as you split the JavaScript logic from the HTML. Note that you can only have one window.onload declaration, so if you already have one, or add one later, you'll need to merge them. In the BODY: <a id="target_anchor">Click me</a> <div id="input_block"> Some input: <input type="text" /> </div> <script type="text/javascript"> document.getElementById('input_block').style.display = 'none'; </script> This second block of JavaScript is placed within the body so that it hides the element as the page is loading, not when it's finished (so you don't see it suddenly disappear at the end). Doing it this way means that when you reload the page with JS disabled, the input will already be visible. Hope this helps. -
I don't think a basic prototype would be difficult for someone with experience of GD, if you had the right graphics. I'd guess that's where the hard work was done here though. A graphic designer would have designed a PNG layer that can site above the floor image to look picture perfect. The PHP would simply handle layering that image above the input flooring image and rendering it. That's what I speculate anyway...
-
Set the vertical-align property to middle for the #searchInput and #searchSubmitButton elements. --- As sandeepcr2 said, there's a lot of space and it doesn't quite look right. I'm also not keen on the choice of font. The one you're using always looks stretched and a little awkward to read in my opinion. The kind of minty pale green colour scheme with the beige background doesn't do it for me either; almost looks bland and dated. The dotted borders mixed with the solid corners looks wrong, and the fairly blurred images used for the header let the site down. The tag cloud looks odd; like there positioned in random places. I'm putting that down to the font and/or margins. There's a flicker when mousing over some of the images that you have grey-scale versions of, which would be better done by pre-loading the images. Looking at the source it's a little mark-up heavy. I think you could condense that down quite a bit. Like for example why wrap the navigation list within a DIV, when you could just apply the same margins to the UL element and achieve the same effect? There's also no use of semantic text tags; p, h1, h2, etc. Not to completely put the site down though, it's a really good effort, but this is a critique after all.
-
S.O.S need help with code links -->hard for me simple for you?
Adam replied to oli22's topic in Javascript Help
To my knowledge you can't use regular expressions within a selector. Use the 'attribute starts with' selector to match all IDs starting with various: $('a[id=^"various"]')... Of course there may be problems if you have other IDs starting with various, but I shouldn't imagine that's hard to avoid. If so as RusselReal suggested, you'd be better off assigning a class, and using $(this).attr('id') to get the element's ID (if needed) - which to be honest may be the better option anyway. -
Set website height according to screen height
Adam replied to charltondurie's topic in Javascript Help
Code like that in the head of the document will never be run. You need to assign the code to an event: window.onload = function() { document.getElementById("main").style.height = screen.height; } Problem here is that this code won't get executed until the page has finished loading, meaning the effect will be very noticeable as the DIV suddenly changes height. I'd move it to the bottom of your body, where the code will be executed instantly and you don't need to assign it to an event: [...] <script type="text/javascript"> document.getElementById("main").style.height = screen.height; </script> </body> </html> Although I should mention, not everybody has JS enabled and this kind of reliance on it for the design isn't the best solution. Perhaps if you post a link to your site we can help you implement the same effect using CSS? -
Wrong forum, this is JavaScript.
-
JavaScript should never be used for password protection. All a user would have to do is view the source of the page and they have the password.
-
var $jq = jQuery.noConflict(); You're removing the $ alias to jQuery with this line, but then trying to use the $ alias later with the second script. Unless you're using other frameworks, you don't need to do that. Remove the line quoted above and convert all "$jq" to just "$". If you do have other frameworks, or use $ in some other way, go through the second script and convert all "$" to "$jq". One other option, if you don't like the "$jq" alias, is to remove the assignment in the line above (i.e. "var $jq =") and access jQuery through it's normal var name "jQuery" - instead of "$jq".
-
I'd say "plug-ins" would be a better word to describe them as a whole.
-
I can't honestly say I know how other large music websites do it, as I've never looked into this much. I had a quick look at a preview on the Amazaon MP3 store, and all they do is play about a minute of a sample track. Amazon's a little different though, because they'll have a feed of data (I imagine) for this kind of thing. Say they didn't, they'd have software on their servers that would generate the sample. The full-length track would obviously only be available to logged in, purchased customers. A request to the URL for the full-length track for un-purchased users would just return an error.
-
Actually the delimiters can be any matching characters you want. You can also use opening/closing paired characters, such as "<...>" and "(...)".
-
MySQL operations can be stopped, but that's at a DBA-level. The time the query would take is completely relative to the size of the table, current server usage, server capabilities, etc. MySQL does support simultaneous queries, but table-level locking on MyISAM tables prevents the same table being written to by 2 queries at the same time. Using LOW PRIORITY will do exactly what it says, delay execution until the table isn't being read/written from. If your table is frequently being accessed, then that's not a good idea as the query could be waiting infinitely. Once the DELETE has started though, it won't get interrupted by another query as it has table-lock.
-
This doesn't really add up. The rewrite rule suggests you're using a hyphen, instead of an underscore? Also matching htm extension, not html.
-
If you're using MySQL, pass strings through mysql_real_escape_string. That will prevent against SQL injections. If you're working with numeric types, then intval or floatval should be used, as it's possible to inject SQL without using quotes.
-
What do you mean by that? How do you think the parameters are passed to this exact page?
-
Define 'deal' with it. I'm not sure what the problem is?
-
No user input is safe. It doesn't matter whether you use _GET, _POST or _REQUEST - a malicious user can still change the value to whatever they like. All data should be sanitized before use within a query, and the logic within your code should prevent someone doing something they shouldn't by just changing the value of the parameter. It's only considered good practise to use the right method for the type of request you're making.
-
Take a look at $_FILES['...']['error'].
-
$result[0] . ' ' . $result[1]