JQuery :: Updated - Make A Template Script Whose Parameters Are Assigned Externally?
Jan 29, 2011
I have an external script that looks for a specific id. Right now (im a noob to scripting btw) id have to have a version of this script in my header for each id or create an external script per id. I would like to have the script use a placeholder where "1stID" is, so that when i call the external script i can just say what the id is.
myscript.js (truncated)
<script>
var v = getelementbyid("1stID");
</script>
I want to call it like: <script src="myscript.js" #ID </script>
View 36 Replies
ADVERTISEMENT
Nov 2, 2011
I am using Jquery Tools Tabs andI want to be able to link from an external page to an open state on tab 2.(External Link to tab 2 --> tab 2 open)Here is my html:
<ul class="tabs">
<li><a href="#tab1" id="tab1">tab1</a></li>
<li><a href="#tab2" id="tab2">tab2</a></li>
[code].....
View 4 Replies
View Related
Sep 6, 2011
If you are using cleditor you know that the CLeditor hides your original textarea en represents its hidden content in an iframe. I have an external imageSelector that appends code to the end of the textarea's content.
$("##pageItem_content_0#rc.cleditorId#").val($("##pageItem_content_0#rc.cleditorId#").val()+insertUrl);
Although this works perfectly, the image does not show unless I toggle the HTML view source button on the cleditor's toolbar.
So my question is: How do I call for a refresh of the text area, so the inserted image is visible immediately? The call has to be made from whithin the (POPUP) <DIV that has been instructed to load my imageSelection page
I have tried the following without results.
// $refresh(pageItem_content_0#rc.cleditorId#);
// $("##pageItem_content_0#rc.cleditorId#").refresh(editor);
// $("##pageItem_content_0#rc.cleditorId#").refresh();
// updateFrame(pageItem_content_0#rc.cleditorId#);
[Code].....
View 2 Replies
View Related
Oct 24, 2010
Another quick question re. the JQuery sidebar I have on my Google map. I would like to link to individual markers from different websites or via email, so would like to convert for example, the 'javascript:myclick(7)' link on the menu to an external URL that will click to the marker and info box containing the video. Is this possible?I have tried something like [URL].. but that doesn't seem to work. Does someone know of anotherwayto do this?[URL]...
View 4 Replies
View Related
Aug 1, 2011
I would like to use JQUERY API in one of my assigned project. I am looking for open source API only, please suggest me if I can go for JQUERY or not..?
View 2 Replies
View Related
Apr 22, 2011
I'm trying to get a external javascript function to execute using php. I have
[Code]...
I am just testing the execution of the function call with an alert(), once the alert fires, I can then test the function itself. I got an alert to execute from the webpage using PHP Code:
[Code]...
But I can't get the alert to execute externally.
View 1 Replies
View Related
Oct 31, 2006
i was searching for that script in this forum, but it seems to be lost or removed?
that script was kinda using activex or vbscript
it writes a .txt or a file to be saved to a location in the hard disk...
(it's not server-side)...can anyone repost that script?
View 6 Replies
View Related
Sep 15, 2011
Does anyone have a way to load an onload into the body tag externally so for example the html page is as follows:
Code:
<html>
<head>
<title></title>
<script type="text/javascript">
[code]...
we are going to have our customers insert some code onto there page and it load out application.instead of telling them to manually change there body tag I want the script to do it for them.
View 2 Replies
View Related
Oct 5, 2011
In the below code, sorted values are coming correctly in alert. I want the sorted values to be in div, #div. When i try to append, the div values are disappearing.
<textarea id='cont'>
View 1 Replies
View Related
Jan 5, 2011
My company uses a software to manage and collect data for equipment. They have a dedicated server to host the software and an internal website that shows all of this data. Though it is an internal website, it can be accessed externally. The website displays data by taking a snapshot of the data from the software and displaying it as a jpeg. It refreshes itself every 30 seconds or so. Here's the problem: When viewing the website externally, the jpeg that shows the data doesn't show because for some reason the webpage thinks you are viewing the site internally, therefore it is trying to pull the image from an internal directory, I think. Now I am familiar with HTML but not with javascript, and the site uses javascript to pull the snapshot image on to the webpage everytime it refreshes.
[Code]...
View 2 Replies
View Related
Apr 30, 2009
For some reason I cannot get jQuery.css('name') to return a style property that was assigned by a class. However, it returns the property if it was assigned by style="". Has anyone else run into this issue? Bug?
Here is my test code:
View 6 Replies
View Related
Feb 13, 2011
I'm trying to build a slideshow for wordpress. On a static page everything works as expected.In Wordpress however, the same script*1* behaves differently. The activeSlide is hidden behind the "default anchor image". I think it's because activeSlide gets assigned to li instead of the a -tag. You can see that with Google Chrome. The activeSlide class is advancing, it's just assigned to the wrong element. I'd like to target the link (a) again, so the green box appears in front of the red box.
This is the script
<script type="text/javascript">
$(function() {
$('#slideshow').after('<div id="slide_navi">').cycle({
fx: 'scrollLeft',
speed: 600,
Timeout: 4500,
activePagerClass: 'activeSlide',
pager: '#slide_navi',
pagerAnchorBuilder: function(idx, slide) {
return '<li><a href="#"><img src="images/transparent.png" /></a></li>';
}});
});
</script>
The only difference is the way I get the images. But this shouldn't change the activePagerClass target, right?
View 4 Replies
View Related
Feb 17, 2010
function get_states(country_element,state_element){
countryElementIDHash = "#" + country_element;
stateElementIDHash = "#" + state_element;
$(stateElementIDHash).empty();
var geonameId = $(countryElementIDHash).val();
$.getJSON("[URL]",
{ 'geonameId': geonameId },
function(data) {
if (data.geonames == null) alert('No regions');
$.each(data.geonames, function(i,item){
$(stateElementIDHash).append($('<option>' + item.name + '</option>'));
});
});
}
I'm writing a function to populate a SELECT based on the select value of another SELECT. I can't figure out why this isn't working. It has something to do with not having "'s in my $(). for example: If this function wasn't dynamic.
The code:
$(countryElementIDHash).val(); could simply be
$("#country option:selected").val();
How can I pass dynamically assigned names into a $() ?
View 1 Replies
View Related
Aug 22, 2010
I'm using the plugin jquery-tmpl. Is there a way to specify a callback after a template is run? I want to do something like
<script id='itemTemplate' type='text/html'>
<li class="item" id=${timestampMs}>
<span class="content">${content}</span>
[code]....
Where processItem does something to the <li> element that just got generated. As it's written, though, the element doesn't exist at the time processItem is called.Here's how I run the template:
// Make the AJAX call to the service
$.ajax({
dataType: "json",
[code]....
View 2 Replies
View Related
Dec 19, 2010
I'm trying to use the jquery template plugin on ie, the code looks great on firefox and chrome but ie refuse to show any data.I'm attaching a sample code , this not the full code, just an example.
<script id="menuitems" type="text/x-jquery-tmpl">
<h2 class="trigger"><span> ${Name}</span></h2>
<div class='toggle_container'>
[code]....
View 3 Replies
View Related
Nov 19, 2010
The following script sets values for various input elements and I want exactly the same function to run for the on blur event of at least two fields. The first half of the script works fine - however when I take the $('#prod_id2unit_price').blur(function() and script it as a separate function and then call it from
$('#prod_id2unit_price').blur(tvf());
$('#prod_id2qty').blur(tvf());
it all stops working -
</script>
<script language="JavaScript" >
$(document).ready(function(){
unitprice0 = $('#prod_id0unit_price').val();
[Code]....
View 2 Replies
View Related
Aug 10, 2011
I have:
<script id="foo" type="text/x-jquery-tmpl">
<p>${100 * parseInt(x)}</p>
</script>
When I do:
$('#foo').tmpl({'x':5}) // or '5'
[Code]...
I've been searching and everything I find says that ${} should be able to handle arbitrary expressions, but there seems to be some syntax magic/intolerance going on here.
View 2 Replies
View Related
Nov 12, 2010
Is it possible to check if template is already compiled and in the stack? For example I need a boolean check, to decide to make ajax call for template or pick it from compiled stack.
var callback = fucntion(template){do stuff...}
var template = $.tmpl('thumbnail',data);
if(!template) {do ajax and get template, then use callback}
else{
callback(template);
}
This would be great, but it doesn't work. $.tmpl doesn't return false if template isn't compiled and in stack.
View 3 Replies
View Related
Jul 1, 2010
been looking for a solution to this one for a couple of days, with no luck, I downloaded an under construction template from herethat incorporates keith wood's countdown timerjquery plugin. Its a perfect template for my site. Trouble is i just can't find a way to adjust the timer. it works fine, without adjusting any of the code but it's default display reads that there's 500+ days estimated to launch. As it's for my business website i don't want people to be put off visiting again, so i wanted to adjust the timer to just a few days. (i.e estimated time of launch 3 days, 72 hrs, however many mins & secs)
[Code]...
View 2 Replies
View Related
Apr 23, 2009
I am using the jquery validation plugin, i am wanting to place all the rrors in one div at the top of the form - which works. The problem is that the first time I submit the form (in FF for MAC) the classes that get assigned to the form elements get added, and removed real quickly. (I have a bg color of red on the form, so i can see a flicker basically) - works just fine in safari. has anyone seen anything like
View 1 Replies
View Related
Oct 19, 2010
I have a template and I am popularing it with .tmpl(). Everything is working fine but now I want to apply some styles, animation effects (fade in/fade out) etc. to elements inside every template row. My problem is that the template rows are getting generated on the fly and I do not know their IDs to access them. What should I do? How can I apply styles and effects to them? Here is my template code:
<script id="container" type="text/x-jquery-tmpl">
<tr>
<td>${Name}</td>
<td>${BirthDate}</td>
[Code].....
View 1 Replies
View Related
Nov 14, 2011
Working throu' the Sammy Tutorial with an intent of using a RESTful django server with sammy.[code]Where the console on chrome reports Uncaught ReferenceError: Sammy is not defined and altho' I get to see the template code in the webpage it does not appear to be rendering.All files are visible from the browser including the template code.The error is reported from line 55 [code]which comes after the function declaration.I'm a python/django creature and rarely venture out to the wilds of the client side. Have I made some particularly simple js/jquery/sammy error ?
View 1 Replies
View Related
Sep 18, 2009
Is there a way to catch when a div content is updated through javascript? I update a div content through rjs and I need to call tablesorter every time the div is updated.
View 3 Replies
View Related
May 24, 2010
I tried assigning 2 error classes to an error message (as a span), but when the empty field was fixed, the error message wouldn't disappear.
$
(
"#testForm"
)
.
[Code]....
With 1 error class it works fine, but adding a second one makes it fail. Here are some links, just hit the submit button a few times on each one to see what I mean
2 classes: [URL]
1 class: [URL]
View 5 Replies
View Related
Oct 13, 2011
The scenario is : I have to fire an ajax request, get the json values and populate the page using jQuery template.
I'm able to fire the ajax request and in the success function I'm getting the data also. But I'm not sure how do I proceed with the Nested JSON data that I have received. I am passing it to the .tmpl() function but nothing seems to be working.
Here is the json data that I receive :
{
"activity": {
"date": [
{
[Code]....
It also gives me an error sometimes that says "c.tmpl is not a function" which is linked to the jquery.tmpl.min.js .
View 1 Replies
View Related
Jun 28, 2010
I have built a website using a)MySQL b)HTML c)PHP and d)Javascript. My website consists of basic html pages/templates which have links to the left and point to another templates/pages. For example, i have 4 templates in my site
1st template is for: News
2nd : Library
3nd : Articles
4th : E-shop
Each template consists of 1. a small menu with links,every link points to another page 2.space for the content/text of the html page 3. a form for searching in the website using php and a mysql database. Well, i'm thinking of adding some animation in my website using the jquery library.Let's say we have an accordion which has 4 choices and when the user clicks on the first choice the 1st template(NEWS) appears inside the slide of accordion,loads in the same slide, not in a new page!!!This is what i would like to do, place in each slide of the accordion one of my templates. CAn this be done? Which are the disadvantages of adding in each slide of the accordion a different template for my site and remain in the same slide when the user clicks in one of the links of the template? Consider that i'm using dynamic content and not static, i have a MySQL database behind.
Also,as i have seen in most examples the options of accordion usually contain an image, a content, a text or links which open in a new window or tab not inside the slide!!!These links do not load in the same slide!!i would like to have a template which loads in the slide each time the user clicks on a link of it.
View 1 Replies
View Related