I have a strange problem that occurs in IE 7 and 8 and does not occur in Firefox or Safari.I'm dynamically adding class to a table row on a checkbox selection. A row contains some input fields that get enabled or disabled. If a row is enabled, it gets highlighted using selectedrow class. If it gets disabled, the class is removed:
I've recently started playing around with jQuery and the jquery-tmpl plugin. I've been fairly impressed with how easy it has been to get my sample apps to call a web service and populate the returned data using a template on my page using something like...
var rendered = $.tmpl("myNamedTemplate", data); $("#resultList").html(rendered);
What I'm currently having trouble understanding is how to get the html results of rendering a template into a string so I can use it with other APIs. I'm working with the Bing AJAX map control and various functions in it's API take HTML as a string parameter.
What I tried first...
var myHtmlTitle = $.tmpl("myTitleTemplate", data); pin.SetTitle(myHtmlTitle);
That didn't quite work like I expected and resulted in an exception from the BING map control. I quickly figured out that what .tmpl was returning was not a formatted HTML string, so it makes sense that would fail.
I then tried appending .html to things and I got close...
var myHtmlTitle = $.tmpl("myTitleTemplate", data).html(); pin.SetTitle(myHtmlTitle);
This did in fact return an HTML string, but the problem is it was stripping off the top-level tag in my template. It's acting like it's returning innerHTML of the top-level tag.
Is there an easy way to simply render the template to a string so I can pass that into the APIs?.
I am loading a list of answers give by a specific user into a tab panel. To do this I'm using the following code: $('#questionBody').load('dashboard/questions'); All the html elements not from a loop such as a header image show up fine but the list of answers looks like it's displayed similar to when you use print_r() on an array. Is load() the proper function to use here?
here's an example of the output: {"status":200,"data":{"questions":[],"params":{"page":false},"user_answers":{"13":{"flagged":"0","regdate":"1282869034","id":"13","qid":"9","body":"an answer of course...","payed":"1","question":{"id":"9","title":"test","body":"test","uid":"1586","permalink":"/question/view/9"},"status":"complete"},"11":
i am wondering, what is the best way to render HTML on a page using an ajax request that gets the data as an XML file?
Say for example you wanted to load the comments on a particular news post, and wanted to pull this data in via ajax, and you server returns an xml with the commens in it, for example:
[Code]...
and then take that xml file and use it to render a list of comments, with profile pictures (worked out from the `profile_id`). I ask as i can do this easy enough by just making the server return the output as HTML, then placing it inside a container for the comments, but this is slower as the html output would be much bigger in size then the xml output.
I also need the ability to add a callback function so i can make a popup display if there is an error, or run a function that does something after the data is loaded. Ideal'y id like to load the html template which i would use along side the xml file, via ajax, but this isnt completely neceserry.
Is there a javascript or jQuery method available to force the browser to render the contents of the window? This would something similar to updating the "stage" in Director or Flash.I have a two-column interaction set up where users input information in one column and see their results in another. Safari, Firefox, etc all work perfectly. IE however needs an extra click anywhere on the browser window for the results to appear. So I'm looking for a way to attach a function to a UI control that 'forces' IE to render the screen so the changes appear.
I am looking for a javascript function that can log the following information for each pageview:
1. The total page rendering time (not php script execution time, but the time at which the entire page is rendered from the user's perspective - all images loaded, ads served etc)
2. The URL of the page
3. The browser used to access the page
4. The country the page was accessed from
The script should then store the information in a database via an AJAX call after it's been collected.
It sounds like a tall order, but it will help me get a picture of how fast or slow my site feels depending on where you live (e.g. how far you are from the server), what browser you're using, and which pages are the slowest to render (keep in mind this is not script execution time or query time, but literally the time at which the page starts to render, to when it finishes rendering).
I'm writing a blog. When a user clicks the make comment link under the comments section for a blog entry, a div pops up with the form that allows them to make a comment. I would like to use XMLHttpRequest to point to a php file that posts the comment, and then display the comment underneath the others that are already there...
This is my first real experience with Javascript in 8 or 9 years, and I've forgotten it almost entirely. I'm working off of tutorials that I'm finding here and there, and have already gotten the XMLHttpRequest to perform the posting of the comment, but I don't know how to write the comment to the end of the comments list without refreshing the page.. Code:
I have a nice javascript slideshow but it kills the rendering speed of my home page. According to Yahoo performance guru(s), javascript gets run before other stuff is rendered, so you fix that by putting the js code "at the end" of the html file.
Putting it at the end puts the slideshow at the bottom which is not the desired result. And even abs positioning is slave to the <div> structure.
How do I nullify the flow just for this one thing (I don't want to make the whole page absolute).
I am trying to find how to use custom tags in html and render data based on their use.
A good example is the joomla <jm:whatever> tag.
I found the following article: [url]
I think it might be outdated though because the behavior:url element does not seem to work. Plus, when I check the style sheet on a joomla site, it doesnt seem to use this method. I think these tags might be xml but I do not know how to render them based on the tag.
For example: <customAbbrv:display src="test.html" label="Test" />
I would want this tag to fire test.html and pass the attribute label which is set to Test.
I have a JSON file with multiple containers that has built a webpage. I need to create a javascript from this file to render a page since it was written to use a js library (I think scriptaculous or doj). I want to use jQuery to do this -- at least that's what I'm told I can do. I understand that JSON is a data-exchange language like XML. Here's some code:
Code: var nov_info= { 'categories':[ {N:'nwItem1',O:'Composition',V:School Supplies > Paper> Notebooks}, {N:'nwItem2,O:'Crayons',V:'Elementary > Art > Art Supplies'}, {N:'nwItem3',O:'Calculators',V:'High School > College Prep> Trigonometry'}, {N:'nwItem4',O:'Maps',V:'Middle School > US History > Civil War'} ], [Code]....
I want to use MathML or maybe javascript graphics and essentially create a real-time math preview. So I want to have a text box where you insert your source code, and I want the preview box to update automatically. For example, say I want the preview box to refresh every time the user enters a space character. Is there a way to get only the new source code entered to render in the preview box without having to re-render the entire preview every time? For example, if a user types 2x^3, I want the math equivalent to show up in the preview window. If a user then types in " + 2x" I want just the " + 2x" part to be drawn right next to the already-drawn "2x^3".
Is this possible? Or is the only way to re-render the entire preview every time the user types in a new term? I would like to only change what the user has edited. If a user edits the middle of the math, then I have no choice and have to re-render everything after what the user has just edited, but when the user is editing the math at the very end, can I not just tag it on to the end and render just that little piece?
Is there a way in Javascript, or perhaps in HTML, to force a browser to re-render an image on an HTML page after a round-trip between the client and the server ?
In my particular case, the image is changing on the server although the URL for it remains the same, but the browser is still displaying the old image from its cache rather than the new image from its URL location.
After toying around for a while with the <canvas> object in HTML5 I came to the disilluding conclusion that text won't render the same smooth way as HTML5 text. Have a look for yourself. The more you magnify the view the more the difference becomes evident:
http://kmt.hku.nl/~walther/test/test2.html
is there any way to achieve the same rendering of text on a canvas than with plain HTML?
I am working on a project using the (brilliant) cycle plugin, here's the scenario: (apologies in advance for bad terminology that may be used)
I have a pager using thumbnail images, the slides contain text, at the moment cycle automatically cycles through the slides. I want each pager thumbnail that corresponds to it's respective slide to grow when active using the hoverpulse plugin.
I've been attempting to use 1.4.1 but I'm finding that $.get() and .getJSON() callbacks fail. The XHR requests succeed. I can examine the full request in both Chrome and Firebug. However, the callback functions *don't* execute. To test, I tried the same url with both 1.4.1, 1.3.2, and via a raw XMLHttpRequest(). The last 2 requests succeed, 1.4.1 fails. //v1.3.2 WORKS, fails in v1.4.1 $.get('/topic/api/template/list', function(data){
I'm was able to successfully use your plugin for firefox, safari, chrome. When the form submits the request with file upload, here is the html I send back to the browser (via Rails): <textarea>{'status': 'success', 'avatar_url': '<%=@user.avatar.url(:medium)%>'}
Here i am posting the request to a servlet.The call is going to the servlet.But i am not able to get the data (filename which i am sending ) in my servlet. How to access the param value in the servlet.
I'm trying to make a jquery powered login and register element within a webpage. The page won't read the value of the forms I want it to read. The page is here[URL].. u1241436/Messages/(login or register forms). I use the following code:
Sorry but I can't get the very first tutorial to work. I put the custom.js in a test_jr directory in htdocs. I also put the starterkit.html file in the same directory. I copied the contents of jquery-1.4.4.min.js into a jquery.js file also in the same directory. Then I did the custom.js page shown here:
I tried clicking on the [URL] and I get the starterkit.html page. If I click on the "some link" it doesn't do anything. What am I missing? There are syntax errors in my editor starting on the line with the asterisks* Why is there an error there? It looks like it closes the click function?
Iam using jquery.validate.js I have a forgot password page it has 2 input fields. 1. User name and 2. Email ID The user has to type any one of the field. How to validate this?
I have been having issues with the .html(), .append() and .prepend() functions. If I attempt the following [code] jQuery doesn't seem to register the click. Is this a known bug? Is there a way around this?
I didn't suspect that it will cause problems, but found that Skype plugin is pasting some JS code into ready page and it search for number which are telephone like. Unfortunately when it matches, it is pasting js code. When tab is changed and I'm returning to the same page tab content is pasted second time in this tab. When I'm doing that again it's pasted third time... It's only happening on tabs on which this toolbar found telephone number.