Hi All,
Using Reflection in PHP I can dynamically create a object like so
$target = 'core_domain_Person';
$reflect = new ReflectionClass($target);
$obj = $reflect->newInstance();
I would like to replicate this same concept in JavaScript is there a way to do this out of the box? Or is there a way to replicate what Reflection is doing?...
I am using a jquery based rich text editor "lwRTE"
It works well in all ways except in changing fontsize
I traced the problem as follows:
when i change the font size the command and the argument is chosen correctly as "font size" and "[the font size in number Eg.6]"
now the execCommand is executed and chrome executes it differently.
...
There's a Google Maps API v3 Visual Studio Intellisense Helper, which presumably works great for Visual Studio, but Aptana (based on Eclipse) uses a different JavaScript documentation format - ScriptDoc (.sdoc files). ScriptDoc is also the name of a VS utility to convert JS files with Intellisense comments into XML, just to confuse thing...
Hi, I need to make this show an error if the user tries to leave the page without checking this tickbox. It has no other use other than visual, is there a way to implement such a thing?
<span>
<input value="1" type="checkbox" name="salgsvilkar" ID="checkbox2" style="float:left;"
onclick="document.getElementById('scrol...
Hi, I've scavenged on every single topic on this forum to try and find an answer before I posted this. Most people say you should simply use SWFUpload, some others mention Activex, and it keeps going.
I know this is do-able, as Google does it with gMail when you try to upload a file that's bigger than 25mb, or executable.
My question i...
How can I send image path to the function? My code is:
<a href="#" onclick="addElement(this.id);" id="cricket" tabindex="1">Cricket</a>
I want to send my image path in the function addElement along with the id.
...
I am trying to create a Google Map where the user can plot the route he walked/ran/bicycled and see how long he ran. The GPolyline class with it’s getLength() method is very helpful in this regard (at least for Google Maps API V2), but I wanted to add markers based on distance, for example a marker for 1 km, 5 km, 10 km, etc., but it see...
I am currently writing an application in JavaScript where I'm matching input to regular expressions, but I also need to find a way how to match strings to parts of the regular expressions.
For example:
var invalid = "x",
potentially = "g",
valid = "ggg",
gReg = /^ggg$/;
gReg.test(invalid); //returns false (correct)
gReg.t...
Hi people,
I'm trying to make a menu that can collapse:
If you click on a button div the menu shows and stays even if you hover the button div.
If you click again on the button div the menu hides.
When the menu is hiding onmouseenter or mouseover it shows onmouseleave or mouseout
it's hiding.
I can't make this happen, this is my co...
I have a simple user control with this code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Pager.ascx.cs" Inherits="Pager" %>
<table style="width: 100%;">
<tr>
<td runat="server" id="PageControls">
<!-- This button has the problem: -->
<asp:Button ID="btnPrevPage" runat="server" Text="&la...
i m using many tiny java script code at one php page, i always write java script code in below style
<script type="text/javascript">
// <![CDATA[
----code 1---------
// ]]>
</script>
<script type="text/javascript">
// <![CDATA[
----code 2-----
// ]]>
</script>
<script type="text/javascript">
// <![CDATA[
$(d...
I am very curious to know how to implement the Ctrl-K (code sample) feature against code,
For example:
public static void main(String args[]){
System.out.println.out("welcome");
}
That will be nicely formatted?
Do we require any package to implement this?
Any ready made code available to do this?
Can any one help me with this...
Hi I'm trying to get this
$( "<div class=\"images\ style=\"background:url('" + item.link + "')no-repeat top center;\"/>").appendTo("#images").wrap("<a target=\"_blank\ href='" + item.link + "'></a>");
to output correctly but I'm not very hot on concatenating javascript strings. It's the line background div I can't get right.
cheers
...
Hi all,
I can't seem to figure out what is wrong with my code. Maybe it would be simpler to just compare date and not time. Not sure how to do this either and I searched but couldn't find my exact problem.
BTW, when I display the two dates in an alert, they show as exactly the same.
My code:
window.addEvent('domready', function() {
va...
Hello, I have javascript code:
function f_dialogOpen()
{
var e_window = document.createElement("div");
e_window.style.position = 'absolute';
var n_width = 300;
var n_height = 200;
var a_docSize = f_documentSize();
e_window.style.left = ((a_docSize[0] - n_width) / 2) + a_docSize[2]) + 'px';
e_window.style.to...
I have a list of <li> elements:
<ul id="mylist">
<li id="item1">Item 1</li>
<li id="item2">Item 2</li>
<li id="item3">Item 3</li>
</ul>
Can I swap two <li> elements - say item1 and item2 - with the replaceChild, one of the DOM tree modification methods? Will it work in all browsers?
...
While coding JavaScript sometimes you store the reference of object this in a local variable for different purposes (to set proper scope, to help code obfuscators, etc.). There are coders who prefer aliasing this to that to make it obvious its intention. Other guys use self since it's pointing to the object itself. I even saw source code...
I want to create a global timer object in javascript and then be able to add callbacks to it on the fly. This way I can just use one global timer in my script to execute all actions at a certain interval rather than wasting resources by using multiples.
This is how I want to be able to piece things together:
var timer = new function() ...
Hi,
I have a sharepoint page that filters a data view from a query string in the address bar. I wanted to add further functionality by also returning back any of the files in the main sharepoint library that matches the query string in the address bar. I added a content editor webpart and I added a xmlHTTPRequest that imports the search...
Hi guys, I'm trying to make 'dark' area when my modal window is opened. Here is what I wrote: the first function f_documentSize will return size of the window, the second one will make fullwindow div.
It works great but there are scrollbars (vertical and horizontal). When I scroll them the page makes bigger (free space). Why?
function ...