1. Commas in a string, that is what,we,are;

    Date: 05/31/06 (Javascript Community)    Keywords: html, database, java

    So I have this simple function that swaps an image and its caption on an HTML page:


    function changeBigImg(source, content) {
    if (source != null) {
    document.getElementById("showedImage").src = source;
    document.getElementById("imageCaption").innerHTML = content;
    }
    }


    The problem being is that 'content' is being fed from a database, and I have no pull on how they enter the data, and some of the strings being fed into 'content' contain commas, which break the function.

    If the title of the image has commas or single quotes, then the JS image switching fuction does not work.

    edited to add examples-
    This one works:

    javascript:changeBigImgSideBar('/photo_servlet?contentId=34153&ver
    sion=1&locale=EN-US&subtype=MIMG','Napoleon Dynamite wishes he had skills like this','height')

    This one does not:

    javascript:changeBigImgSideBar('/photo_servlet?contentId=33918&ver
    sion=1&locale=EN-US&subtype=MIMG','Cindy, Kim, and Q doing their best Sinead O'Connor impersonations','width')

    Slight variance from js protocol in my examples aren't the problem -- it consistently happens with commas and/or single-quotes.

    So I was pondering if anyone had a suggestion for a way to replace the commas in the string with commas that will only be read as text, not seperators.

    Thank you!

    Source: http://community.livejournal.com/javascript/100742.html

  2. DRY Accessor Helper

    Date: 06/01/06 (Javascript Community)    Keywords: html, java

    I got tired of creating accessor methods for properties (as well as the properties themselves!) in my javascript classes, so, taking a note from the prototype.js library, I wrote a helper which acts a little like ruby's attr_writer and attr_reader as well as method_missing. It's loosely based upon a MockObject class written by William Tayson at http://www.jadetower.org/muses/archives/000388.html. The library itself does not have any dependencies, although I am (for convenience sake) using it with the prototype.js Object.extend() function in the example which follows. // Accessors
    // Based on an idea from William Tayson ( http://www.jadetower.org ):
    // "Bringing method_missing to javascript" --
    // http://www.jadetower.org/muses/archives/000388.html
    //
    // To create a "mixin" for accessor methods.
    //
    // Part of the Tarpaulin Project
    //
    // tarpaulin.rubyforge.org
    //
    // Written by ottercat -- ottercat@ottercat.net
    //
    // No dependencies on other code

    // a helper function used below by multiple functions/objects
    function accessorWrapper(method){
        return function(arg) {
        var property=method.substr(3);
        var mode=method.substr(0,3);
        if(mode == "get")
          {
              return this[property];
          }
        else
          {
              this[property]=arg;
          }
        }
    }


    // create both a getX() and setX()
    function Accessors(properties) {
        properties=properties.split(/[ \t\n]+/);
        for (var i=0; i < properties.length; i++)
          {
          this[properties[i]]="";
          getter="get"+properties[i].substr(0,1).toUpperCase()+properties[i].substr(1);
          this[getter]=accessorWrapper(getter);
          setter="set"+properties[i].substr(0,1).toUpperCase()+properties[i].substr(1);
          this[setter]=accessorWrapper(setter);
          }

    }

    // follow the ruby convention here of creating a reader

    function attrReader(attributes) {
        properties=properties.split(/[ \t\n]+/);
        for (var i=0; i < attributes.length; i++)
          {
          if(this[attributes[i]] == undefined)
            {
            this[attributes[i]]="";
            }
          getter="get"+attributes[i].substr(0,1).toUpperCase()+attributes[i].substr(1);
          this[getter]=accessorWrapper(getter);
          }
    }

    // follow the ruby convention here of creating a writer

    function attrWriter(attributes) {
        properties=properties.split(/[ \t\n]+/);
        for (var i=0; i < attributes.length; i++)
          {
          if(this[attributes[i]] == undefined)
            {
            this[attributes[i]]="";
            }
          setter="set"+attributes[i].substr(0,1).toUpperCase()+attributes[i].substr(1);
          this[setter]=accessorWrapper(setter);
          }
    }
    Here's test code, showing usage..... var test={
      fred : "flintstone",
      tom : "jerry",
      foo : function() { alert("test!");}
    };

    Object.extend(test,new Accessors("name rank"));
    test.setName("Barney Fife");
    test.setRank("Deputy");
    for (i in test)
    {
    document.write(i + "
    ");

    }
    document.write(test.getName()+"
    ");

    document.write(test.getRank()+"
    ");

    I'll have this shortly posted to CVS, but what do you think?

    Source: http://community.livejournal.com/javascript/101086.html

  3. Creating random directories in VB.NET

    Date: 06/02/06 (Asp Dot Net)    Keywords: html, asp, security, web

    Hi folks...long time reader, first time poster.

    I have a piece of code that SHOULD be working. It is simple and straight forward, creating a directory.

    The code:

    Dim tmpfldr As String = secret.buildFLDR() ' Build a 10 character, semi random string for a DIR Name
    'This is the URL that will be used to create the links
    targetfullpath = "http://" & cfg.serverURL & "/" & cfg.RootDBFolder & "/" & tmpfldr
    filesysfullpath = cfg.filesysFLDR & "\" & cfg.RootDBFolder & "\" & tmpfldr
    Me.lblUploadStat.Text = Me.filesysfullpath
    'filesysfullpath = "\" & tmpfldr
    Dim tdir As DirectoryInfo
    Dim usr As String = "Current executing thread is " + System.Security.Principal.WindowsIdentity.GetCurrent().Name
    Try
    If Directory.Exists(filesysfullpath) = False Then
    ' Create the directory.
    Directory.CreateDirectory(filesysfullpath)

    ....

    It gets to this line and throws an error:

    System.IO.DirectoryNotFoundException: Could not find a part of the path "e:\". at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.Directory.InternalCreateDirectory(String fullPath, String path) at System.IO.Directory.CreateDirectory(String path) at mjbears.drpbox.loadcfg() in C:\Documents and Settings\Jim\VSWebCache\sandbox.pixieproductions.com\default.aspx.vb:line 100

    The "filesysfullpath" resolves out to "e:\web\public_html\username\sandbox\dropbox\BUILDFLDR" where BUILDFLDR is the random string. I have read/write privileges in "dropbox" folder, so I should be able to write/create a directory there.

    Help! I've been hacking on this code for hours!

    Peace,

    Bear

    Source: http://community.livejournal.com/aspdotnet/69908.html

  4. very cool design from ikea

    Date: 06/03/06 (WebDesign)    Keywords: html

    http://demo.fb.se/e/ikea/dreamkitchen/site/default.html

    Source: http://community.livejournal.com/webdesign/1120319.html

  5. the-name-of-this-file

    Date: 06/04/06 (Javascript Community)    Keywords: html, java, web

    hello,
    maybe it is a lame question, but anyway...
    i am making a website in more than one language version and i have put the html files of every version to a separate directory. the names of files are the same in every directory.
    now i would like to have links on every page to switch to another version of this page easily. i think about using javascript [written in separate file], if it is possible.
    is there a code meaning "the name of this file"? so that i could write "../nameofdesireddirectory/" before it and have a link to the file with the same name but placed in another directory?

    could you help me?
    thanks in advance! :)

    Source: http://community.livejournal.com/javascript/101546.html

  6. CSS question

    Date: 06/06/06 (Web Development)    Keywords: browser, css, html

    I'm working on a program that needs to be able to automatically modify some given HTML, wrapping text with links. In other words, what originally used to be text will now be a link. The problem is that this link MUST look exactly the same as it did when it was just text (in the same browser). This needs to be done automatically with any given HTML.

    Now for the question:
    Is there a way to do this without parsing css and calculating the style for the text element, calculating the style for the new link element, and wrapping the text inside the link with a span revesing the effects of the link style? For example, can I specify in a span tag that the included element should not inherit style from its parents?

    Any and all ideas are welcome, post away...

    Source: http://community.livejournal.com/webdev/326950.html

  7. I'm so green at js...

    Date: 06/10/06 (Javascript Community)    Keywords: css, html, seo

    I need a onMouseover script that will allow the following action: when one image is rolled over, another image (although a div would be much better than another image) would fade in. I really like this script from dynamic drive, but it only allows for text to appear, where I need a div or image...but at least that's the general effect I'm looking for.

    I'm fairly knowledgable in html and css, so if someone could point me in the right direction for a script (or if there's a way to customize the above script to allow it to include a div), I should be able to figure out the implementation. Gah, sorry for being so vague! Please feel free to ask questions and maybe I can help clarify if necessary. :)

    Source: http://community.livejournal.com/javascript/102023.html

  8. what questions do i need to ask?

    Date: 06/13/06 (WebDesign)    Keywords: html, web

    Hello. I have been asked by my boss to help update our ancient website. I know enough html and will have enough helpers that I should be ok, however I have one minor snag...

    i've never edited an existing website someone else set up before.

    I need to know what information I am going to need from the person who was working on the site a year ago. I assume I shall need a password, and to know the url for the administering page of the site, but is there anything else i will need?

    Thank you very much, I hope you can help me find what I need.

    Source: http://community.livejournal.com/webdesign/1124254.html

  9. Easier web site building?

    Date: 06/13/06 (HTML Help)    Keywords: html, web

    I am building a web page for a small tile company. However, I am trying to make it as easy for them to update as possible once I am finished. Anyway, in the gallery, each page's name is a letter followed by a number. The letter indicates a specific room/job and the number represents the specific picture. For example, if A1 is a picture of a bathroom, A2 is another picture in the same bathroom while B1 would be a kitchen or different room altogether. I want to make it so my client can copy the html from one page into a new page and switch the picture without having to change the "previous gallery" "previous picture" "next picture" "next gallery" because they will automatically know what should be the next or previous logical link. Is this possible?

    Source: http://community.livejournal.com/htmlhelp/2316569.html

  10. Read-only dropbox

    Date: 06/15/06 (C Sharp)    Keywords: html

    I couldn't find a property in combobox that allows me to create a drop-down combo box that is not editable. I just need a regular drop-box like the ones created by html. Is there a sepearte control for it?

    Source: http://community.livejournal.com/csharp/65450.html

  11. Forms-issues

    Date: 06/19/06 (WebDesign)    Keywords: html, web

    Forms giving me a headache. (i think it's the forms, maybe the problem is somewhere else in the code though....)


    There are two registration forms on my website; International & USA Residents.
    They are the exact code except for the [Country] select in International, & [State] select in USA registration form.

    I've been staring at both codes for about 6 hours and can't seem to find the problem.

    http://www.gazettestreet.net/international_reg.html ~ the form is perfect
    http://www.gazettestreet.net/usa_reg.html ~ the [state] select is all the way to the right and is off.

    I tried to make all the code look the same (including the modifiers for the selects) but it still won't give in.
    Can anyone check the sources for both pages and let me know where the glitch is hidding?

    Thanks a million in advanced~


    Thanks~
    ~K

    Source: http://community.livejournal.com/webdesign/1126348.html

  12. Flash 8 Professional Question

    Date: 06/20/06 (Computer Geeks)    Keywords: html

    I have a small flash movie that works exactly the way I want while in flash. When I publish, the .swf file plays fine in the flash player. However, when I publish and view in an html document, several layers are simply not there. Any advice?

    Source: http://community.livejournal.com/computergeeks/940491.html

  13. making an online retail store

    Date: 06/21/06 (WebDesign)    Keywords: php, mysql, css, html, sql, java, shopping

    I have a quick question about making an online store. I already know XHTML and CSS but as far as i know i cant make a shopping cart with just this. I think PHP and MySQL is what i need to learn but is that all i need or would i have to dig deeper into programing with something like OOP with Java or JPS?

    Source: http://community.livejournal.com/webdesign/1128443.html

  14. Flash 8 Professional Question

    Date: 06/20/06 (WebDesign)    Keywords: html

    I have a small flash movie that works exactly the way I want while in flash. When I publish, the .swf file plays fine in the flash player. However, when I publish and view in an html document, several layers are simply not there. Any advice?

    Source: http://community.livejournal.com/webdesign/1127792.html

  15. file editing

    Date: 06/22/06 (PHP Community)    Keywords: php, html

    Is there a simple way (or is there code out there now) that can allow me to edit a (local) html page? I have a file upload page working, but I now want to be able to update links on a separate page that is on the same server (same folder) so that there is a link to the file.

    I once did this on python but that box died a horrible death a year or two ago and naturally I do not have any backups). I was able to open a file, look for a specific string like <###REPLACEME###> and then stick what I needed in front of it. Can this be done in php?

    Source: http://community.livejournal.com/php/463063.html

  16. HTML question

    Date: 06/22/06 (Web Development)    Keywords: browser, html, java

    Here's a question for an answer to which I've been looking for but haven't found yet. This is more of a HTML/Javascript question than anything else.

    Let's say I have the following HTML snippet:

    ...


    some text

    here

    to fill up the space


    ...

    Is there a way to make the onClick event take precedence over the href link in the browser (short of removing the 'a' tag alltogether)?

    I realize that the above snippet is probably not the best coding practice, but it's a result of an automated process which I need to modify.

    Source: http://community.livejournal.com/webdev/329761.html

  17. help with cloneNode script

    Date: 06/22/06 (Javascript Community)    Keywords: html

    I am trying to create a script that will add a new field when the user clicks on a link. I am using the cloneNode feature to take the existing field and make a new one based on that. This script works great in firefox on my mac, but fails on IE 6 in Windows.

    The script: 



    var counter = 0;

    function addGiftCard()
    {
        counter++;
        $('cardCount').value=counter;
        var newFields = $('GiftCard').cloneNode(true);
        newFields.id = '';
        newFields.style.display = 'block';
        //alert("innerhtml = " + newFields.childNodes[1].innerHTML);
        newFields.childNodes[1].id = "giftCardDesc" + (counter + 1 );
       
        newFields.childNodes[1].innerHTML = "Gift Card " + (counter + 1) + " - Amount";
       
        var newField = newFields.childNodes;
        for (var i=0;i    {
            var theName = newField[i].name
            if (theName)
                newField[i].name = theName + counter;
               
           
        }
       
        var insertHere = document.getElementById('writeroot');
        insertHere.parentNode.insertBefore(newFields,insertHere);
    }


    And here is the HTML:

    + Add Gift card


       Gift Card 1 - Amount$




     Any ideas why this works on firefox and fails in IE?

    Source: http://community.livejournal.com/javascript/103463.html

  18. Layout help please.

    Date: 06/23/06 (WebDesign)    Keywords: css, html, web

    Hi all!

    Im an ameteur web designer who really designs for my own hobbies.

    I am teaching myself Dreamweaver and have had some experience building basic html pages in FrontPage and Notepad.

    I have a website that I want to update. The current format uses anchoring to move people from chapter to chapter within the one page. I have been told that perhaps CSS is a better layout way for me to show my webpage stories.

    Ideally I would like a navigation side bar on the left. Ideally I would like the header etc at the top. I deally I would want a footer which holds the copyright etc. THe section on the right would contain each chapter. Chapter 2 would replace chapter 1 once chapter 2 was selected on the nav bar etc. etc.

    My original post was in my own LJ and can be found HERE

    I welcome any critisisms on how I could "better" my layout and any advice on how things could be done.

    Thanks.
    Shanna

    Source: http://community.livejournal.com/webdesign/1129216.html

  19. Layout help please.

    Date: 06/23/06 (Web Development)    Keywords: css, html, web

    Hi all!

    Im an ameteur web designer who really designs for my own hobbies.

    I am teaching myself Dreamweaver and have had some experience building basic html pages in FrontPage and Notepad.

    I have a website that I want to update. The current format uses anchoring to move people from chapter to chapter within the one page. I have been told that perhaps CSS is a better layout way for me to show my webpage stories.

    Ideally I would like a navigation side bar on the left. Ideally I would like the header etc at the top. I deally I would want a footer which holds the copyright etc. THe section on the right would contain each chapter. Chapter 2 would replace chapter 1 once chapter 2 was selected on the nav bar etc. etc.

    My original post was in my own LJ and can be found HERE

    I welcome any critisisms on how I could "better" my layout and any advice on how things could be done.

    Thanks.
    Shanna

    Source: http://community.livejournal.com/webdev/330169.html

  20. Rus.Only : Вышел АЛГОРИТМ №9

    Date: 06/23/06 (C Sharp)    Keywords: html, sql

    Содержание - http://dotnetgrains.sql.ru/alg/content7to9.html
    Скачать - http://dotnetgrains.sql.ru/alg/alg.htm

    Source: http://community.livejournal.com/csharp/67054.html

Previous page  ||  Next page


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home