I have no experience with Javascript at all, and this is probably tricky without the full code, but I'll give it a try anyways:
I have a page with two dropdowns (date and month), which generates a (0,0) value, (date,month).
I need to input those two values separately in two different locations in a generated URL. How can I split up the keys-result, instead of it being (0,0)?
CODE GENERATING URL;
PARTIAL CODE FROM DROPDOWN;
Can I maby add something to the "result.keys"-string to point to the "var days / var month"?
I need to take the text in a textarea, split it into an array, and have the items in the array be added to a dropdown menu. When I try to split the value of the textarea (which, by the way, contains comma-delimited text) into an array, the array invariably ends up with only one item in it, and that item contains the entire contents of the textarea all jammed together with the commas removed.
The offending code:
Code:
In my test page, the text area (DownListTextBox) contains "yes,no" and when the alert fires it shows that the array has a length of 1. The Option added to the dropdown list has a text of "yesno". So, what did I do wrong?
I'm just fooling around trying to make a simple ChatterBot. And I'm using IE to make a simple database of Answers and Sentences. Problem is it's acting odd when it's spliting into an array. In Answer.txt I have "Hello, *UserName*." (Which I will use the replace() to change that later.) And in Sentence.txt I have.... I always use "Hello." as the message. It's suppose to compare the message with the sentences... Both lowercased and symbols removed. But it doesn't seem to work just right when coverting the Text file to array.
I am making a form using HTML and java where you enter a number and it uses an equation then spits out another number. My problem is I want to split the number you put into the form and add it up. Example You enter"457829"Press "convert"And the first step I want it to do is"4+5+7+8+2+9=sumA"Then"sumA/8"So far I can only do the sumA/8 if I manually add up the numbers then place the sum in the form, here's the code:
Is there any was to prevent ampersand from splitting up the passed data? For example if my data looks like: "This is some text&blah blah" If I pass it as data it will get split up at "&": This is some text blah blah
I'm writing this web app.For each view, when required, I'll have one or more script files named after the view. Some functions are shared across the site. So I extracted and put them into separate .js files. Some views may have sub-views (such as the login box).
And I ended up with 10 <script> tags per page (includes 3 jquery must-haves). Although in some pages I can lower it to 6, I still think this is a pretty big number, as lots of extra HTTP transaction is required when loading the page.
I put the <script> tags at the end of the page, before closing <body>. Most scripts didn't use $(document).ready().
So is it bad to have 10 <script> tags on each page? Is there a magic number I should never surpass? Is it a good idea to put lots of (unrelated) functions into a single .js?
And is it bad to have scripts executing at the end of the page rather than $(document).ready ?
I'm using ajax to store values from a form into MySQL. The form contains a text field named "title" and the method I'm using to fetch and pass on the data to the backend is shown below: _data = "title=" + $( '#title' ).val(); $.ajax({ async: true, type: "POST", url: "backend.php", dataType: "json", data: _data, success: function( json ) { .... } }});
The method works fine for normal text, say "This is a sample text". However, if an ampersand is used in the title text (example: "This & That"), the post value is being truncated at the ampersand. In effect, the & in it is causing the string to be split up into two segments and the part after the & is being treated as a variable, i.e. instead of passing title = This & That What is being passed is, title = This That = * as shown by Firebug
I'm would like to add a light box to a site that has content generated by php. Basically it is a property site and will have a thumbnail image and description. When the user clicks on thumbnail I would like to display a gallery of pictures relevant to the property. Each property will be generated dynamically by php. My question is how do I enter the selector for the gallery into jquery. I am thinking of using Fancy Zoom as you can use hidden elements, as the gallery will be hidden.
I am trying to truncate some text within a 'span' in order to create a 'more/less' button to show/hide the additional. I effectively want to turn this:
The site I'm working on uses a CMS (which I have no access to, nor control over the output), and in one section of the site, it outputs divs like this (I've changed the actual ID names for clarity's sake)...
Now then, I need to be able to check if a div is called 'generated-div-[number]', and I thought the best way to go about this would be to use regex. However, most of my regex experience comes from doing PHP work.
So far, I've got this...
That's a slightly simpler version of what I want it to do (i.e: in the end, I don't want to merely change the BG colour), but I mainly need some help with the regex and 'if' part of things.
Maybe this is a whacky question, but is it possible, with Javascript, to dynamically generate new functions - that is, execute the text contents of a variable?
I'm new to the forums, yet not new to jQuery. Still, I never had to get properties from objects generated on-the-fly, till now. I have a pager generated by cycle plugin, for each slide, a button is created, and the container of those buttons is enlarged. The amount of slides is determined by the user, so can't specify a default or maximum width. When I examine the object with firebug, I get the full width, including the generated pager buttons. But my script keeps on getting 0 as width, which is the width of the element when the page loads.
Anyway, is there a way around this? In case I haven't explained myself well, say it and maybe I can paste the code.
I've got a hidden template div that contains an <LI> that is cloned and added to an <UL> on the fly. The cloned <LI> items have placeholder IDs. What I want to do is find all the IDs *within the cloned <LI>* that has a defined string in it (and then replace that string with the proper index, etc.)
So, for example, here's the HTML of the template: <DIV id='thisLineRowTemplate' style="display:none"> <LI class='arrow' id='thisLineTemplateLI'> <a href='#ex_EXNUMBER'> <DIV class='LABELCLASS thisLine_labelContainer'> <TABLE height=100% width=100%> <TR valign='center'><TD align='center'>EXLABEL</TD></TR> </TABLE> </DIV> <IMG id='thisLine_checkmark_EXNUMBER' class='thisLine_checkMark_off' src="assets/checkmark.png" width=60px height=54px> <DIV id='thisLine_item_EXNUMBER' class='thisLine_exNameContainer'> <TABLE height=100% width=100%> <TR valign='center'><TD>EXNAME</TD></TR> </TABLE> </DIV> </a> </LI> </DIV>
And here's the code so far: for(rowIdx=0;rowIdx<theRows.rows.length;rowIdx++) { thisRow = $("#thisLineTemplateLI").clone(); $(thisRow).attr({'id':'thisLineRow_'+rowIdx, 'display':'block'}).appendTo("#theList") $(thisRow 'select[id*="EXNUMBER"]').each(function() {console.log("Found a EXNUMBER")}); }; Line 4 is what's stumping me. The <LI>s are being cloned perfectly. I've tried a couple of different selectors but honestly, I'm still pretty new to jQuery, so some of the concepts continue to elude me. At this point, all I get is "Parse Error" on that line.
I use milonic s menu for my website, as such i need to generate some sort of site map so that the various crawlers can get full access....I used to use the phpsite map which came with Milonic Menu, however since i have moved hosts, this has stopped working. [URL] any offers on why it has stopped working are welcome (windows hosting)as it still works on my other site (linux hosting)[URL]anyway, thats not the point of my post....Also provided by milonic is the option to provide a list based menu using some js...
[URL]
I have incorporated this into my site
www.tugtracker.co.uk - click misc on the menu then "Site index" You will see a pop-up erm pops up.... This looks okay and something like what i want, However i need it to be placed into a webpage so i can give it a www.tug..... address and then i can point the crawlers at it.... How do i code it into the page to that the JS will run within the body and result within the body of a page?
Is it possible to view the source as generated by the Javascript?? and how can I make it , coz I did a report table and I made the calculations from some values by javascript that are not displayed in the inner tags of the HTML source code; I have heard about "generated source code" but I don't know how to use it. Another problem that my web browser should be IE6 , so I m using this version only and I cant use firefox ..so I need to export this report to PDF or word file.
I have a link here http://183.78.169.54/v3/addCVC.php. First if you select the name T1 via ajax the second drop down list is populated. Then pick anyvalue from the second drop down list and your will get a table populated below it. Then finally when you press submit button I call the validation function. In there I got this little codes.The alert keep showing me null even though the table is generated with its relevant values too. What is the problem ya?
Code: var table = document.getElementById("listOfCorrection"); //var checkbox = table.getElementsByTagName("input"); alert("tableContent:"+table);
Hi all, I have a site with frames. There is a list in the left hand frame generated by php/MySQL - list.php, and the detail of one of the listed items is shown in the main page - main.php.
While list.php reads each item from the database it generates a clickable link to main.php of the form:
Code: <a href="javascript:void (parent.main.location='main.php?id=123');">name123</a> When list.php comes to the default item, it also generates an autolink of the form:
Code: <script language="javascript" type="text/javascript"> void(parent.main.location='main.php?id=345'); </script> Although this works OK, when I look at the generated HTML (using the browser 'source' view) there is the following javascript coding in addition to the above - is this supposed to be there or is it an error?
Code: <script language="JavaScript"> <!-- function SymError() { return true; } window. var SymRealWinOpen = window.open; function SymWinOpen(url, name, attributes) { return (new Object()); } window.open = SymWinOpen; //--> </script> and ...
I want to dynamically generate list box options using the content of an sql database in real time. More specifically, i have a page with a couple of listboxes, when i click on an option in the first list box, i want the second list box to update with options that reflect the first one, in real time generated by the sql database.now i was wondering if it might be possible for javascript to send some thing to php which php could decode and search the database and return the results of that search. here is how i imagine the process to look in psudeo code:- user clicks on an option (say the 3rd option) in the 1st listbox- javascript catches the event, and sends some data to php indicating the 3rd option from the 1st listbox has been clicked- php tells sql to search for records that correlate with the 3rd option from listbox 1- php sends search result back to javascript- javascript populates the 2nd listbox with search resultsi want to do this with out having to refresh the webpage, security issues aint high, cause this project probably aint gonna go on the web. I got the idea from the dynamic searching on google, so i guess such technology is possible some how.
I am writing an extension to a third party application. this application generates code dynamically using insertAdjacentHTML(). I want to execute my function whenever the insertAdjacentHTML is called. Does insertAdjacentHTML() fire any event that i can handle and execute my function? or is there any other solution?