Building Own Library For Full Control On My Website?
Mar 23, 2011
I'm looking at creating my own JS library. Experience/Show employer, and I want 100% control over my websites. Anyways, I'm a huge fan of JS, yes, I said that, and I'm asking people who have done it, what are the major pitfalls and what should I look out for during the process? Experiences will vary, but trying to get some incite before moving forward.
i was building a website using two jquery codesfirst one for the slideshow banner and the other one for the menu but only one of them works, i've search on the web and i fouond something called jquery no conflict()is this good?this is the code inside de <head> tags
I am using GreaseMonkey to load jQuery 1.3.2 (there is a bug with the latest version of jquery and GM) and jQuery UI 1.8.0.I am using jQuery via GM to manipulate the GUI of a content management system. This CMS uses its own JS library to dynamically add stuff to the dom.
Question:How can I target a dom element that was added to the dom via this other JS lib?In other words, the CMS will add a div to the dom, and I am not sure how to tell jquery to wait for these elements to "be there" before applying the jquery goodness. Specifically, I would like to do this:
$(function() { $('#zen1227').resizable(); });
But "#zen1227" does not "appear" until later via this other JS library.
Situation:I have a very long page divided into many sections vertical-wise marked by bookmarks, say pageX.html#s1 to s10. I need to show the section inside an iframe (iFrame1) on the mainpage (mainpage.html). I am thinking of having 4 buttons, sitting on the mainpage, to help navigate between these sections on pageX, namely NEXT, PREVIOUS, TOP, END.condition of the frame, fixed width/height, no scroll, no border.Very new to javascript but need this code to make a page work for BIZ.
I'm trying to code a feature for my website using DHTML where the person viewing the website can rotate between viewing the positive/negative points of the website being reviewed. This example was in the publication called Using HTML 4 by Lee Anne Phillips. Code:
I have a ajax program on a page on website A. And I need to let it talk to a program on website B. I tried to put website B into the url of the parameter but it doesn't work.It gives me a "[objet XMLHttpRequest]" error.here is the code on website A:
I'm trying to build a PC building form using drop-down menus. I want to use the values of each option in the menu and add them together to get the total price, then display the total price somewhere on the page.
I'm trying to combine some javascript variables into a URL, so I can pass the screen resolution to PHP to determine how large a popup window should be.
What I want to end up with is something like: <a href="url.php?w=1024&h=768">Click me</a>
I'm still working on same task New problem: When I place text in a rectangle, then wish to overwrite it,(that is replace it with new test,) I cannot remove the earlier text. The new overlays the old, an unreadable mess.
Moreover, what I have achieved works only in Opera. FF tells me I have too much recursion (None that I'm aware of). I cannot get any feedback from IE.
I would like to know if there exists a javascript library (at least for IE and Firefox) that let me get css properties in a more structured way. I would like to have a css value that seperates the size/length value from the type. For example:
width: 2.5em size=2.5 type=em
And most importantly I would like a way to convert each such value into pixels.
Does it exist? I am aware of the CSSStyleDeclaration and related methods in Firefox.
If not, is it possible to convert such a value as 2.5em into pixels in javascript? Sometimes the standard available methods that return pixels cannot calculate the value I need. For example calculating the border size.
I want to have one statement in my web page that includes a single file (for example "Mylib.inc" that contains a list of ".js" files to include. Is that possible? And if so can some one show me the basic format to use?
This would allow me to add and remove scripts from my pages without having to edit each page, only w3ouyld need to make a change in the MyLib.inc file I'm envisioning MyLib.inc to look something like this:
I know nothing about javascript at the moment, but I've been hitting php very aggressively the past few months.
I've came across a challenge and I'm not sure how to go about fixing it.
Basically, I need to be able to drag an image into a box on my webpage, crop it, and then upload it. I've done basic image uploading and resizing with php. That's no big deal.
The problem is I may want to crop in different spots. The idea is to have some sort of box tool that is set at a given aspect ratio (like Photoshop does). Then, I could select the part of the image I wanted to keep, hit one button that would then crop, resize, and upload the image (storing the pathway to the MySQL database).
So does anyone know of any either standalone GUI's that work well for this sort of image manipulation or possibly a javascript that will allow me to select part of the image and spit out some co-ordinates that I could use with php's GD Library.
I have a form that has two radio buttons. When the first one is clicked, I would like the page to refresh (keeping the form data in tact) and then displaying 2 new fields that need to be filled out. If the second button is clicked, I need the same thing to happen, only it will display two different fields needing to be filled out.
Does anyone have code that will do this? Or is this even possible with JavaScript?
OK, I am looking for advice or tips and suggestions. I have overcome a lot of the obstructions I had to building the page design my customer was asking for. I am looking now at ways to deliver content dynamically within the wonderful framework I created. Whilest I look into the various methods of delivering content within a container of one form or another in the existing HTML, I am also exploring the possibility of using some form of 'wrapper' for existing flat pages sorta like how geocities does to user pages to add the yahoo pull-down div layers and such.
While doing some testing, I notice that if I just add a javascript tag in the beginning, I can't use the document.body.AppendChild option for the div layers unless I call the function that builds said layers from a <body onload="">. When I do it from the onload event, the existing HTML layers can effect the placement of the div layers even when I have the CSS position set to absolute.
Short of using some form of server side code to insert at least the DIV content in prior to dropping the file on the user's browsers, I was wondering if there were any other suggestions on how to do this with a minimal amount of coding in the HTML document itself. One of my hopes is to limit the 'modifications' to any standard HTML file to one or two lines so that anyone else developing pages can do so easily, and/or I can create reasonably foolproof server-side wrappers to call the javascript code to paste on the 'look-and-feel' elements on just about any web page.
I have a feeling I will probably go the server-side route anyway, but I was just curious what other suggestions there might be out there.
I want to do this with a checkbox and am falling down on it... Code: var i=0, elem, qstr=''; while(elem=document.forms['form1']['quantity'+(++i)]){ qstr += (qstr.length ? '&' : '?') + 'quantity' + i + '=' + elem.options[elem.selectedIndex].value; }
Here is the checkbox Code: <input type="checkbox" name="approved[]" onclick="boxchk(this,6)" checked="checked" value="'".$j['id']."'"/>
I am very new to web development. I would like my website to have an application which allows a user to draw images which can be displayed on other users screens in real time.
An example of this is isketch.net Also on this site i would like users to be able to create accounts and join 'rooms' where they can communicate in real time (as opposed a forum message board). I am looking for something similar to isketch.net
Could somebody please tell me the type of development and programming needed. I have been quoted 1000 a month to build these capabilities but have no idea what is involved. (also may require facebook style real-time updating)
I am trying to build my first script. My problem, is I'm trying to build a multi hide/show script, displaying paragraphs of information. If I want multiple variables for the script do I have to use an array? and if so, how can I construct this array?
Here is my script as of now,
<!-- // this tells jquery to run the function below once the DOM is read $(document).ready(function() {
[code]....
Right now the script doesn't work with the bottom two variables profile_"ect."
I'm fooling around with building a form that grows depending on the users input (relatively new to DOM 2 - but fun stuff!) I'm working on getting it to work (rather than being pretty - there are many improvements that could be made).
My question is has anyone seen any similar examples out there? The more I build on this thing, the more I believe there has to be another way... (like rather than creating every pull-down box - yes, I should put that into it's own function! - should I be playing with visibility and positioning?) Code:
I want to be able to set 'thevariable' in the shtml page that calls that include and pass it to that string - I'm thinking that because I don't want to use php/asp that Javascript is the best way?
I'm building a web site ala autos.yahoo.com on servicos.mpl.pt/comparador/css1.php I have a sidebar with filtering options grouped in an accordion. The accordion panels get populated via jquery like:
point out where my logic is flawed in this? Or where my scripting is wrong?I'm trying to build a standard HTML table with 5 columns across and as many rows down as necessary, to fit all of the images in an array (brought into the DOM via PHP).My goal is to have rows of 5 columns that add on to accomodate up to 50 total images (10 rows).Here's my logic (flawed or not):*Look at the number of tems in the array*If the number is greater than 5, build one full row (of 5 <td>s)*Check again - is the number of items in the array greater than 10?*Build another row*If not, build a partial row, and fill in the rest of the <td>s (less than a full row) with blank spaces.The question is whether or not my logic is being represented in the javascript?unctions in <head>calls to function on lines 149-159Don't mind the formatting, I've blown it up so I can see what's going on.